Changes between Version 35 and Version 36 of Email2tracMta
- Timestamp:
- 08/19/10 09:04:57 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Email2tracMta
v35 v36 1 2 [[ShowPath]] 3 [[PageOutline]] 1 [[ShowPath]] [[PageOutline]] 4 2 5 3 = Mail server configuration = 6 7 4 It depends on your Mail Transfer Agent (MTA) how the setup. 8 5 6 == Postfix == 7 The procedure is: 9 8 10 == Postfix == 11 12 The procedure is: 13 * Edit your alias definition file (default : /etc/aliases) for Postfix and add one line per project you 14 want to allow ticket submission from email to. For each alias you can specify: 15 * --project: This option selects a configuration stanza in the [wiki:Email2tracConfiguration config file] 9 * 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: 10 * --project: This option selects a configuration stanza in the [wiki:Email2tracConfiguration config file] 16 11 * --ticket_prefix: [https://subtrac.rc.sara.nl/oss/email2trac/wiki/Email2tracConfiguration#Defaultvaluesforticketfields Default values for tickets] 17 12 {{{ 18 13 tracproj: |"/usr/bin/run_email2trac [--project=<name>] [--ticket_prefix=<name>]" 19 }}} 20 14 }}} 21 15 22 23 * Update your alias database with command ''newaliases'' 24 * '''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! 25 26 16 * Update your alias database with command ''newaliases'' 17 * '''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! 27 18 28 19 === Note for postfix === 20 `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 `chown`ing 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`. 29 21 30 {{{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 {{{chown}}}ing 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}}}. 31 32 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) 33 -- mpalmer@hezmatt.org. 22 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. 34 23 35 24 == Sendmail == 25 The procedure is: 36 26 37 The procedure is: 38 * Edit your alias definition file (default : /etc/mail/aliases) for Sendmail and add one line per project you 39 want to allow ticket submission from email to. For each alias you can specify: 40 * --project: This option selects a configuration stanza in the [wiki:Email2tracConfiguration config file] 27 * Edit your alias definition file (default : /etc/mail/aliases) for Sendmail and add one line per project you want to allow ticket submission from email to. For each alias you can specify: 28 * --project: This option selects a configuration stanza in the [wiki:Email2tracConfiguration config file] 41 29 * --ticket_prefix: [https://subtrac.rc.sara.nl/oss/email2trac/wiki/Email2tracConfiguration#Defaultvaluesforticketfields Default values for tickets] 42 30 {{{ … … 44 32 }}} 45 33 46 * Update your alias database with command ''newaliases'' 47 34 * Update your alias database with command ''newaliases'' 48 35 49 36 === Note for Sendmail === 50 This is a message from emailtotrac tickets archive: 37 1. Your sendmail might look like it's running as root (using 'ps') but you should use the "id trick" detailed at https://subtrac.sara.nl/oss/email2trac/ticket/126 38 39 to double-check. You may well see that sendmail actually runs as user 'daemon' so you need to re-run configure and rebuild. 40 41 2. This is a message from emailtotrac tickets archive: 42 51 43 {{{ 52 44 Sendmail limits the executables that can be run via aliases to those in a … … 75 67 that next. Is there a log generated anywhere? 76 68 }}} 69 == Exim Setup == 70 As with Postfix, `run_email2trac` is unnecessary. Instead of editing the `/etc/aliases` file, one must create a router and a transport. My own Debian-compatible configs follow. Slight modification should make them usable for you. 77 71 78 == Exim Setup ==79 80 As with Postfix, {{{run_email2trac}}} is unnecessary. Instead of editing the {{{/etc/aliases}}} file, one must create a router and a transport. My own Debian-compatible configs follow. Slight modification should make them usable for you.81 72 {{{ 82 73 theblackbox:/etc/exim4/conf.d# cat router/101_exim4-config_trac_gw … … 100 91 101 92 == Fetchmail Setup == 93 For those of you that installed the mail server on a different server than the subversion/trac server, you might want to use fetchmail instead. I have succeeded by simply set the mda value in /etc/fetchmailrc to run_email2trac 102 94 103 For those of you that installed the mail server on a different server than the subversion/trac server, you might want to use fetchmail instead.104 I have succeeded by simply set the mda value in /etc/fetchmailrc to run_email2trac105 95 {{{ 106 96 mda "/usr/local/bin/run_email2trac" … … 109 99 110 100 === Using procmail with fetchmail & email2trac === 111 You may want to filter bounced messages from ever getting to email2trac, otherwise you can end up in an infite loop. 112 Simply change your mda in your .fetchmailrc to procmail and create a .procmailrc like this: 101 You may want to filter bounced messages from ever getting to email2trac, otherwise you can end up in an infite loop. Simply change your mda in your .fetchmailrc to procmail and create a .procmailrc like this: 102 113 103 {{{ 114 104 PATH=/bin:/usr/bin:/usr/bin … … 122 112 | /usr/local/bin/run_email2trac 123 113 }}} 124 125 114 Now only messages that aren't from a daemon or bounced will make it to email2trac. 126 115 127 116 == Qmail Setup == 128 129 117 qmail has .qmail files for each user. /var/qmail/mailnames/domain/ will have a list of user directories, each of which contains a .qmail file. In the .qmail file for your trac user, insert the following: 130 118 … … 132 120 |preline "/usr/local/bin/run_email2trac [--project=<name>] [--ticket_prefix=<name>]" 133 121 }}} 134 135 122 Preline is a qmail helper that appends proper email headers to emails, in order that "traditional" filtering programs can deal with qmail emails. 136 123 … … 138 125 139 126 On some qmail installation this won't work 'cause run_email2trac isn't able to change uid to the trac-user. So, first of all there should be a sudoers for the user calling it: 127 140 128 {{{ 141 129 popuser ALL = (wwwrun)NOPASSWD: /usr/local/bin/run_email2trac 142 130 }}} 143 131 Change ''popuser'' to the user the qmail helper runs as. 132 144 133 {{{ 145 134 |PYTHON_EGG_CACHE=<path-to-dir> /var/qmail/bin/preline /usr/bin/sudo -u wwwrun /usr/local/bin/run_email2trac 146 135 }}} 147 148 136 Of course don't forget required --project option :). The PYTHON_EGG_CACHE variable should point to a area the trac user may write. If you don't need it, remove this. 149 137 … … 151 139 152 140 == Test Setup == 141 In the source distribution there is a file ''msg.txt''. You can use this file to test the email2trac configuration: 153 142 154 In the source distribution there is a file ''msg.txt''. You can use this file to test the email2trac configuration:155 143 * Test with a command like : 156 144 {{{ 157 145 email2trac --project=tracproj < msg.txt 158 146 }}} 147 159 148 If this command succeeds then email2trac is setup correctly, else you received an error on stdout or syslog, depends on your [wiki:Email2tracConfiguration email2trac.conf] setup. 160 149 161 150 The next step is to test the MTA setup. Use an email client to mail to the address you setup for email2trac, eg: subtrac@sara.nl 162