Changes between Version 35 and Version 36 of Email2tracMta


Ignore:
Timestamp:
08/19/10 09:04:57 (14 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Email2tracMta

    v35 v36  
    1 
    2 [[ShowPath]]
    3 [[PageOutline]]
     1[[ShowPath]] [[PageOutline]]
    42
    53= Mail server configuration =
    6 
    74It depends on your Mail Transfer Agent (MTA) how the setup.
    85
     6== Postfix ==
     7The procedure is:
    98
    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]
    1611   * --ticket_prefix: [https://subtrac.rc.sara.nl/oss/email2trac/wiki/Email2tracConfiguration#Defaultvaluesforticketfields Default values for tickets]
    1712{{{
    1813     tracproj: |"/usr/bin/run_email2trac [--project=<name>] [--ticket_prefix=<name>]"
    19 }}}
    20    
     14}}}
    2115
    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!
    2718
    2819=== 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`.
    2921
    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.
     22The 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.
    3423
    3524== Sendmail ==
     25The procedure is:
    3626
    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]
    4129   * --ticket_prefix: [https://subtrac.rc.sara.nl/oss/email2trac/wiki/Email2tracConfiguration#Defaultvaluesforticketfields Default values for tickets]
    4230{{{
     
    4432}}}
    4533
    46   * Update your alias database with command ''newaliases''
    47 
     34 * Update your alias database with command ''newaliases''
    4835
    4936=== Note for Sendmail ===
    50 This is a message from emailtotrac tickets archive:
     371. 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
     39to double-check.  You may well see that sendmail actually runs as user 'daemon' so you need to re-run configure and rebuild.
     40
     412. This is a message from emailtotrac tickets archive:
     42
    5143{{{
    5244Sendmail limits the executables that can be run via aliases to those in a
     
    7567that next. Is there a log generated anywhere?
    7668}}}
     69== Exim Setup ==
     70As 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.
    7771
    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.
    8172{{{
    8273theblackbox:/etc/exim4/conf.d# cat router/101_exim4-config_trac_gw
     
    10091
    10192== Fetchmail Setup ==
     93For 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
    10294
    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_email2trac
    10595{{{
    10696mda "/usr/local/bin/run_email2trac"
     
    10999
    110100=== 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:
     101You 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
    113103{{{
    114104PATH=/bin:/usr/bin:/usr/bin
     
    122112| /usr/local/bin/run_email2trac
    123113}}}
    124 
    125114Now only messages that aren't from a daemon or bounced will make it to email2trac.
    126115
    127116== Qmail Setup ==
    128 
    129117qmail 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:
    130118
     
    132120|preline "/usr/local/bin/run_email2trac [--project=<name>] [--ticket_prefix=<name>]"
    133121}}}
    134 
    135122Preline is a qmail helper that appends proper email headers to emails, in order that "traditional" filtering programs can deal with qmail emails.
    136123
     
    138125
    139126On 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
    140128{{{
    141129popuser ALL = (wwwrun)NOPASSWD: /usr/local/bin/run_email2trac
    142130}}}
    143131Change ''popuser'' to the user the qmail helper runs as.
     132
    144133{{{
    145134|PYTHON_EGG_CACHE=<path-to-dir> /var/qmail/bin/preline /usr/bin/sudo -u wwwrun /usr/local/bin/run_email2trac
    146135}}}
    147 
    148136Of 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.
    149137
     
    151139
    152140== Test Setup ==
     141In the source distribution there is a file ''msg.txt''. You can use this file to test the email2trac configuration:
    153142
    154 In the source distribution there is a file ''msg.txt''. You can use this file to test the email2trac configuration:
    155143 * Test with a command like :
    156144{{{
    157145email2trac --project=tracproj < msg.txt
    158146}}}
     147
    159148If 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.
    160149
    161150The 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