Email2trac

De Slacam_Wiki
Ir para: navegação, pesquisa

Instalação do email2trac

Installation

First get the latest stable source of the package from:

    ftp://ftp.sara.nl/pub/outgoing/email2trac.tar.gz 

Contains

The email2trac package contains the following utilities:

email2trac::

   Converts an email to ticket. Reads a config file email2trac.conf

run_email2trac::

   Suid program that changes the MTA-user to the TRAC-user so that we can save attachments

delete_spam::

   A small program that deletes the SPAM tickets from the database

email2trac.conf::

   Configuration file to set the behavior for email2trac.

Build process

Warning Icon Image Pay attention to the MTA_USER and TRAC_USER, they are not something you can ignore!

Unpack the tarball. There are several methods to build the package. No package manager

The configure script build default is /usr/local

./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

If you want the python scripts to be included in the buildprocess add --enable-python

Mail server configuration

It depends on your Mail Transfer Agent (MTA) how the setup. Postfix

The procedure is:

   Edit your alias definition file (default : /etc/aliases) for Postfix and add one line per project you want to allow ticket submission from email to. For each alias you can specify:
       --project: This option selects a configuration stanza in the config file
       --ticket_prefix:  Default values for tickets
            tracproj: "|/usr/bin/run_email2trac [--project=<name>] [--ticket_prefix=<name>]"
   Update your alias database with command newaliases
   Hint: Please note that postfix seemingly runs commands from the alias definition file as user "nobody", even if the rest of it is running as user "postfix". So please assure that the MTA_USER is set to nobody, not to postfix! 

Note for postfix

run_email2trac is totally unnecessary for Postfix. You can run a delivery command as any user just by placing the aliases in a separate file and chowning that aliases file to the user you want the delivery to run as. Then you run postalias /path/to/aliases, which will create /path/to/aliases.db, and you then just add hash:/path/to/aliases to the alias_maps config variable in main.cf.

The only caveat is that the user who owns the separate aliases file needs to have write perms to the directory that it's stored in (which rules out putting it in /etc/postfix unless you're nuts) -- mpalmer@hezmatt.org.