source: emailtotracscript/trunk/INSTALL @ 106

Last change on this file since 106 was 106, checked in by bas, 16 years ago

EmailtoTracScript?:

Added:

  • email2trac.spec file thanks to Jon Topper
  • Property svn:mime-type set to text/x-trac-wiki
File size: 5.0 KB

Installation and Configuration of email2trac

The email2trac package contains the following utilities:

email2trac.py : converts an email to ticket. Reads a config file

email2trac.conf

run_email2trac.c: suid program that changes the MTA-user to the TRAC-user so

that we can save attachments

delete_spam.py : small program that deletes the SPAM tickets from the database email2trac.conf : read by email2trac.py to set the various options. This are

the options:

 [DEFAULT]                  # REQUIRED
 project: /data/trac/jouvin # REQUIRED
 debug: 1                   # OPTIONAL, if set print some DEBUG info
 spam_level: 4              # OPTIONAL, if set check for SPAM mail
 reply_address: 1           # OBSOLETE, see trac.ini notification section
 reply_all: 1 	            # OPTIONAL, if set then put all CC-addresses in ticket CC-field
 umask: 022                 # OPTIONAL, Use this umask for saving attachments
 mailto_link: 1             # OPTIONAL, if set then [mailto:<CC>] in description
 mailto_cc: ticket@test.nl  # OPTIONAL, Use this address as CC in mailto line
 ticket_update: 1           # OPTIONAL, if set then check if this is an update for a ticket
 email_header: 1            # OPTIONAL, if set then show TO/CC fields in description
 trac_version: 0.8          # OPTIONAL, if set use this as trac version (D: 0.9)
 enable_syslog: 1           # OPTIONAL, if set log errors to syslog, note errors are not
                                        mailed back to the reporter.
 [bas]                     # OPTIONAL project declaration, also set
                           # project option, use -p|--project
 project: /data/trac/bas   #
 spam_level: 2             # Override DEFAULT spam_level, can also be
                           # done for other options

Installation and Configuration

First build, install email2trac :

option 1:

  • ./configure (see --help)
    default values for:
       prefix=/usr/local        --> --prefix=<path>
       exec_prefix=$prefix/bin  --> --exec_prefix=<path>
       sysconfdir=$prefix/etc   --> --sysconfdir=<path>
       MTA_USER=nobody          --> --with-mta_user=<name>
       TRAC_USER=www-data       --> --with-trac_user=<name>
    
  • make
  • make install
  • First install copy emailtrac.conf to $sysconfdir

option 2:

  • debian/rules binary
  • First install copy emailtrac.conf to /etc

option 3:

  • cp email2trac.tar.gz /usr/src/redhat/SOURCES
  • rpmbuild -ba email2trac.spec

After installation, edit email2trac.conf for your site. Most important parameter is project, see above

If you have enabled 'ticket_update' in email2trac.conf then you have to choose one of these options to make it work:

1 - Configure trac notification, eg:

  • (ticket address: ticket@…) [notification] smtp_enabled = true smtp_always_cc = test@… smtp_server = localhost smtp_from = ticket@… always_notify_reporter = true

2 - Use the mailto_cc in email2trac.conf if you want to sent

an email to the user and the trac ticket email address via the mailto link

Usage

It depends on your MTA how the setup is. For Sendmail and Postfix, the p rocedure is the same :

  • Edit your alias definition file (default : /etc/aliases for Postfix, /etc/mail/aliases for Sendmail) and add one line per project/component you want to allow ticket submission from email to. For each alias, you can specify option --project. This option selects a configuration stanza in the config file and --component to specify a component other than the default component for the project. Line must have the following format :
         tracproj: |"/usr/sbin/run_email2trac [--project=<project_name>] [--component=<project_component>]"
    
  • Update your alias database with command newaliases
  • Test with a command like :
         mail tracproj
    

Note for Sendmail

This is a message from emailtotrac tickets archive:

Sendmail limits the executables that can be run via aliases to those in a
special directory, and runs them using a restricted shell called smrsh.
On RH, the default location for the allowed programs is /etc/smrsh.
I tried both a link in that dir to the run_email2trac file and a little
shell script that simply calls run_email2trac and passes the params. Both
should work, but neither did yet. Majordomo works the same way, and it
set up on the machine already so I'll check on that later today.
I found a pretty good walk-through of the problem/solution at
http://archives.free.net.ph/message/20030605.105120.74c3bfa8.html
Well, I was in fact doing the right thing. Here's all the steps to follow
post make install
ln -s /usr/local/bin/run_email2trac /etc/smrsh/run_email2trac
in aliases use:
"|run_email2trac -project=bas"
Note: Include the quotes, they are necessary. That got me past the
sendmail problem. No ticket appeared in the project, but I'll look into
that next. Is there a log generated anywhere?
Note: See TracBrowser for help on using the repository browser.