Changes between Version 2 and Version 3 of WikiStart


Ignore:
Timestamp:
12/05/06 17:17:45 (16 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v2 v3  
    1 = Welcome to email2trac on subtrac.sara.nl =
     1[[PageOutline]]
     2= Convert email to trac tickets =
    23
    3 Edit deze pagina om met de documentatie te beginnen, zie [wiki:TracWiki trac wiki handleiding] hoe te beginnen. Voor verdere informatie zie [wiki:TracGuide trac handleiding].
     4== Description ==
    45
    5 '''Happy Trac-ing'''
     6=== email2trac utilities ===
     7
     8This is a release of the SARA package email2trac that contains utilities that
     9we use to convert emails to trac tickets. The initial setup was made by
     10Daniel Lundin from Edgewall Software. SARA has extend the initial setup,
     11with the following extensions:
     12  * HTML messages
     13  * Attachments
     14  * Use commandline options
     15  * Use config file to change the behaviour of the email2trac.py program
     16  * Some unicode support for special characters in the headers of an email
     17    message
     18
     19See INSTALL for the how to setup the utilities
     20
     21Comments or Suggestions mail them to:
     22 * [mailto:basv@sara.nl Bas van der Vlies], more info about [http://www.sara.nl/index_eng.html SARA]
     23 * [mailto:walter@sara.nl Walter de Jong]
     24
     25Contributor: (0.9 port + implemented some new features)
     26 * Michel Jouvin
     27
     28== Bugs/Feature Requests ==
     29
     30Existing bugs and feature requests for EmailtoTracScript are
     31[report:9?COMPONENT=EmailtoTracScript here].
     32
     33If you have any issues, create a
     34[http://trac-hacks.org/newticket?component=EmailtoTracScript&owner=bas new ticket].
     35
     36== Download ==
     37
     38Download the latest stable source from ftp://ftp.sara.nl/pub/outgoing/email2trac.tar.gz.
     39
     40== Source ==
     41
     42You can check out EmailtoTracScript from [http://trac-hacks.org/svn/emailtotracscript here] using Subversion, or [source:emailtotracscript browse the source] with Trac.
     43
     44==  Installation and Configuration  ==
     45
     46The email2trac package contains the following utilities:
     47 '''email2trac.py'''::   
     48    Converts an email to ticket. Reads a config file email2trac.conf
     49 '''run_email2trac.c'''::
     50    Suid program that changes the MTA-user to the TRAC-user so that we can
     51    save attachments
     52 '''delete_spam.py'''::
     53    A small program that deletes the SPAM tickets from the database
     54'''email2trac.conf'''::
     55    Is read by email2trac.py to set the various options. This are the options:
     56
     57|| NAME || VALUE || Explanation ||
     58|| [!DEFAULT]  || ||  REQUIRED ||
     59|| project:  || /data/trac/jouvin || REQUIRED ||
     60|| debug: || 1                 ||  OPTIONAL, if set print some DEBUG info ||
     61|| spam_level: || 4          || OPTIONAL, if set check for SPAM mail ||
     62|| drop_spam: || 0           || OPTIONAL:, if set then reject mail marked as SPAM ||
     63|| reply_all: || 1 || OPTIONAL, if set then put all CC-addresses in ticket CC-field ||
     64|| umask: || 022             || OPTIONAL, Use this umask for saving attachments ||
     65|| mailto_link: || 1          || OPTIONAL, if set then {{{[mailto:CC]}}} in description ||
     66|| mailto_cc: || ticket@test.nl ||  OPTIONAL, Use ths address as CC in mailto line ||
     67|| ticket_update: || 1    || OPTIONAL, if set then check if this is an update for a ticket ||
     68|| email_header: || 1       || OPTIONAL, if set then show TO/CC fields in description||
     69|| trac_version: || 0.9     || OPTIONAL. if set then use this as version number, default 0.9
     70|| alternate_notify_template || a_ticket.css || OPTIONAL if set then use this style sheet for notify ||
     71|| enable_syslog || 1    ||  OPTIONAL, if set log errors to syslog, note they are ''not'' mailed back to the reporter ||
     72
     73|| || ||
     74|| || ||
     75|| [bas] ||                               || OPTIONAL project declaration, also set project and use --project option  ||
     76|| project:||  /data/trac/bas  || ||
     77|| spam_level:|| 2                 || Override DEFAULT spam_level, can also be done for other options  ||
     78
     79
     80=== Installation and Configuration ===
     81 
     82First build, install email2trac :
     83
     84==== Configure ====
     85  * ./configure (see --help)
     86    {{{
     87    default values for:
     88       prefix=/usr/local        --> --prefix=<path>
     89       exec_prefix=$prefix/bin  --> --exec_prefix=<path>
     90       sysconfdir=$prefix/etc   --> --sysconfdir=<path>
     91       MTA_USER=nobody          --> --with-mta_user=<name>
     92       TRAC_USER=www-data       --> --with-trac_user=<name>
     93    }}}
     94  * make
     95  * make install
     96  * On the first install, copy {{{email2trac.conf}}} to {{{$sysconfdir}}}   
     97
     98==== Debian package ====
     99  * debian/rules binary
     100  * dpkg -i ../email2trac_<version>.deb
     101  * cp email2trac.conf /etc
     102
     103==== RPM package ====
     104  * cp email2trac.tar.gz /usr/src/redhat/SOURCES
     105  * rpmbuild -ba email2trac.spec
     106
     107
     108After installation, edit email2trac.conf for your site. Most important
     109parameter is project, see above
     110
     111If you have enabled 'ticket_update' in email2trac.conf then you have
     112to choose one of this options to make it work:
     113  *  Configure trac notification, eg:
     114{{{
     115      (ticket address: ticket@test.nl)
     116      [notification]
     117      smtp_enabled = true
     118      smtp_always_cc = test@test.nl
     119      smtp_server = localhost
     120      smtp_from =  ticket@test.nl
     121      always_notify_reporter = true
     122}}}
     123  *   Use the mailto_cc in email2trac.conf if you want to send an email to the ticket email address.
     124
     125
     126== Usage ==
     127
     128It depends on your MTA how the setup is. For Sendmail and Postfix, the procedure is the same :
     129 * Edit your alias definition file (default : /etc/aliases for Postfix,
     130   /etc/mail/aliases for Sendmail) and add one line per project/component you
     131   want to allow ticket submission from email to. For each alias, you can
     132   specify option --project. This option selects a configuration stanza in the
     133   config file and ''--component'' to specify a component other than the
     134   default component for the project. Line must have the following format :
     135{{{
     136     tracproj: |/usr/bin/run_email2trac [--project=<name>] [--component=<component>]
     137}}}
     138
     139  * Update your alias database with command ''newaliases''
     140  * Test with a command like :
     141{{{
     142     mail tracproj < msg.txt
     143}}}   
     144  * if mail fails you can also check if it is an email setup error or a trac-setup error, test it with the following command:
     145{{{
     146email2trac --project=tracproj < msg.txt
     147if this is okay then it is an email setup error
     148}}}
     149
     150=== Note for postfix ===
     151
     152{{{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}}}.
     153
     154The 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) 
     155-- mpalmer@hezmatt.org.
     156
     157=== Note for Sendmail ===
     158This is a message from emailtotrac tickets archive:
     159{{{
     160Sendmail limits the executables that can be run via aliases to those in a
     161special directory, and runs them using a restricted shell called smrsh.
     162On RH, the default location for the allowed programs is /etc/smrsh.
     163
     164I tried both a link in that dir to the run_email2trac file and a little
     165shell script that simply calls run_email2trac and passes the params. Both
     166should work, but neither did yet. Majordomo works the same way, and it
     167set up on the machine already so I'll check on that later today.
     168
     169I found a pretty good walk-through of the problem/solution at
     170http://archives.free.net.ph/message/20030605.105120.74c3bfa8.html
     171
     172Well, I was in fact doing the right thing. Here's all the steps to follow
     173post make install
     174
     175ln -s /usr/local/bin/run_email2trac /etc/smrsh/run_email2trac
     176
     177in aliases use:
     178
     179"|run_email2trac -project=bas"
     180
     181Note: Include the quotes, they are necessary. That got me past the
     182sendmail problem. No ticket appeared in the project, but I'll look into
     183that next. Is there a log generated anywhere?
     184}}}
     185
     186== Author/Contributors ==
     187
     188'''Author:''' [wiki:bas], [mailto:walter@sara.nl Walter de Jong][[BR]]
     189'''Contributors:''' Michel Jouvin, Kilian Cavalotti