| | 6 | |
| | 7 | = Installation and Configuration of email2trac = |
| | 8 | |
| | 9 | The email2trac package contains the following utilities: |
| | 10 | * email2trac.py: converts an email to ticket. Reads a config file email2trac.conf |
| | 11 | * run_email2trac.c: suid program that changes the MTA-user to the TRAC-user so that we can save attachments |
| | 12 | * delete_spam.py: small program that deletes the SPAM tickets from the database |
| | 13 | * email2trac.conf: read by email2trac.py to set the various options. This are the options: |
| | 14 | {{{ |
| | 15 | [DEFAULT] # REQUIRED |
| | 16 | project_root: /data/trac # REQUIRED if project: doesn't specify a project |
| | 17 | # full path, else OPTIONAL |
| | 18 | project: bas # OPTIONAL if project_root: present, |
| | 19 | # else REQUIRED and MUST specify a project full path |
| | 20 | debug: 1 # OPTIONAL, if set print some DEBUG info |
| | 21 | spam_level: 4 # OPTIONAL, if set check for SPAM mail |
| | 22 | reply_address: 1 # OPTIONAL, if set then fill in ticket CC field |
| | 23 | umask: 022 # OPTIONAL, Use this umask for saving attachments |
| | 24 | mailto_link: 1 # OPTIONAL, if set then [mailto:<CC>] in description |
| | 25 | email_header: 1 # OPTIONAL, if set then show TO/CC fields in description |
| | 26 | trac_version: 0.8 # OPTIONAL, if set use this as trac version (D: 0.9) |
| | 27 | }}} |
| | 28 | |
| | 29 | == Installation and Configuration == |
| | 30 | |
| | 31 | First build, install email2trac : |
| | 32 | |
| | 33 | * Edit Makefile, adjust the variables (in particular INSTALL_DIR, MTA_USER and TRAC_USER) |
| | 34 | * make |
| | 35 | * make install |
| | 36 | * Define a symlink /etc/email2trac.conf referencing $INSTALL_DIR/email2trac.conf |
| | 37 | |
| | 38 | After installatin, edit email2trac.conf for your site. Most important parameters are project_root: and project:. project: defines a default project, when project_root: is specified. |
| | 39 | |
| | 40 | == Usage == |
| | 41 | |
| | 42 | It depends on your MTA how the setup is. For Sendmail and Postfix, the procedure is the same : |
| | 43 | |
| | 44 | * 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 to specify a project other than the default configured inside the configuration file (project must be located below ''project_root'') and option ''--component'' to specify a component other than the default component for the project. Line must have the following format : |
| | 45 | {{{ |
| | 46 | tracproj: |/usr/sbin/run_email2trac [--project=<project_name>] [--component=<project_component>] |
| | 47 | }}} |
| | 48 | |
| | 49 | * Update your alias database with command ''newaliases'' |
| | 50 | * Test with a command like : |
| | 51 | {{{ |
| | 52 | mail tracproj < test7.eml |
| | 53 | }}} |