| 1 | = Connvert email to trac tickets = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | = email2trac utilities = |
| 6 | |
| 7 | This is a release of the SARA package email2trac that contains utilities that |
| 8 | we use to convert emails to trac tickets. The initial setup was made by |
| 9 | Daniel Lundin from Edgewall Software. SARA has extend the initial setup, |
| 10 | with the following extensions: |
| 11 | * HTML messages |
| 12 | * Attachments |
| 13 | * Use commandline options |
| 14 | * Use config file to change the behaviour of the email2trac.py program |
| 15 | * Some unicode support for special characters in the headers of an email |
| 16 | message |
| 17 | |
| 18 | See INSTALL for the how to setup the utilities |
| 19 | |
| 20 | Comments or Suggestions mail them to: |
| 21 | * Bas van der Vlies basv@sara.nl |
| 22 | * Walter de Jong walter@sara.nl |
| 23 | |
| 24 | Contributor: (0.9 port + implemneted some new features) |
| 25 | * Michel Jouvin jouvin@lal.in2p3.fr |
| 26 | |
| 27 | http://www.sara.nl for more info about SARA. |
| 28 | |
| 29 | |
| 30 | == Bugs/Feature Requests == |
| 31 | |
| 32 | Existing bugs and feature requests for EmailtoTracScript are |
| 33 | [report:9?COMPONENT=EmailtoTracScript here]. |
| 34 | |
| 35 | If you have any issues, create a |
| 36 | [http://trac-hacks.swapoff.org/newticket?component=EmailtoTracScript&owner=bas new ticket]. |
| 37 | |
| 38 | == Download == |
| 39 | |
| 40 | Download the zipped source from [download:emailtotracscript here]. |
| 41 | |
| 42 | == Source == |
| 43 | |
| 44 | You can check out EmailtoTracScript from [http://trac-hacks.swapoff.org/svn/emailtotracscript here] using Subversion, or [source:emailtotracscript browse the source] with Trac. |
| 45 | |
| 46 | == Example == |
| 47 | |
| 48 | The email2trac package contains the following utilities: |
| 49 | email2trac.py:: |
| 50 | Converts an email to ticket. Reads a config file email2trac.conf |
| 51 | run_email2trac.c:: |
| 52 | Suid program that changes the MTA-user to the TRAC-user so that we can |
| 53 | save attachments |
| 54 | delete_spam.py:: |
| 55 | A small program that deletes the SPAM tickets from the database |
| 56 | email2trac.conf:: |
| 57 | Is read by email2trac.py to set the various options. This are the options: |
| 58 | {{{ |
| 59 | [DEFAULT] # REQUIRED |
| 60 | project: /data/trac/bas # REQUIRED |
| 61 | debug: 1 # OPTIONAL, if set print some DEBUG info |
| 62 | spam_level: 4 # OPTIONAL, if set check for SPAM mail |
| 63 | reply_address: 1 # OPTIONAL, if set then fill 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 | email_header: 1 # OPTIONAL, if set then show TO/CC fields in description |
| 67 | }}} |
| 68 | |
| 69 | == SETUP == |
| 70 | |
| 71 | It depends on your MTA how the setup is. Below is an example of the SARA setup |
| 72 | that uses postfix as our MTA. |
| 73 | * Copy email2trac.conf to /etc (default location for email2trac.py) |
| 74 | If different location use the -f <filename> option for email2trac.py |
| 75 | * Postfix run as user 'nobody' and the apache as user 'www-data'. To enable |
| 76 | saving of attachments we must use 'run_email2trac.c'. We do not have to |
| 77 | adjust the values. If you use other accounts then adjust the c-file: |
| 78 | gcc -o run_email2trac run_email2trac.c |
| 79 | default path for email2trac.py is /usr/sbin |
| 80 | * cp run_email2trac /usr/sbin |
| 81 | * chmod 4111 run_email2trac |
| 82 | * cp email2trac.py /usr/sbin |
| 83 | * vi /etc/aliases |
| 84 | bas: |/usr/sbin/run_email2trac |
| 85 | * newaliases |
| 86 | * Test |
| 87 | cat test7.eml | mail bas |
| 88 | |
| 89 | == Author/Contributors == |
| 90 | |
| 91 | '''Author:''' [wiki:bas] [[BR]] |
| 92 | '''Contributors:''' |
| 93 | |
| 94 | [[TagIt(script,bas,0.8,0.9)]] |