Edgewall Software

Changes between Version 1 and Version 2 of Email2tracOnWindows


Ignore:
Timestamp:
Mar 12, 2008, 10:20:37 PM (14 years ago)
Author:
anonymous
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Email2tracOnWindows

    v1 v2  
    99To actually get emails to the server, you have to use the address "anyth...@trac-server.domain.com".  Your exchange or other mail server should automaticly forward the emails to the server.  If you want to use a different form, you will likely have to configure your mail server to forward the mail.  The name before the @ can be anything; POP service usually uses this, SMTP and email2trac ignore it.  A
    1010possible enhancement to email2trac would be to use the address to identify the destination environment for the ticket.
     11
     12Thanks, Matthew, for your detailed response.  It's amazing what a couple edits to the email2trac.py script can do!  I'm happy to say that I've now got it all working smashingly.
     13
     14A bit about my working solution:
     15
     16
     171. Fetchmail -- Retrieves email from the Exchange server.  I have it set up to automatically feed retrieved messages to the script so I don't need an additional script to do this.  At some point I might want to change this piece of the equation to get rid of the overhead of the Cygwin component, but it's working and I like having to do a little Unix-y work.  Relevant .fetchmailrc file: poll mail.domain.com with proto IMAP, auth ntlm user "t...@domain.com" with password "xxx" is trac here options keep
     18mda "C:/python25/python.exe C:/projects/email2trac/email2trac.py"
     19
     202. email2trac script -- As can be seen in the above .fetchmailrc file, I put my script and related files in the path C:/projects/email2trac. I made the changes to email2trac.py that Matthew mentions along with a couple changes specific to my solution. 
     21
     22* Config file variable -- Since I'm calling the script from fetchmail, I needed to specify the full path to the config file in the email2trac.py script, i.e. C:/projects/email2trac/email2trac.conf     
     23
     24* Signature stripping -- I found that the signature stripping done in the script when the strip_signature config variable was set didn't work correctly for the format of our emails so I made a slight edit to the script.  In the section of the script that defines useful mail constants (around line 141), I added the variable self.get_signature_match = '---'.  Then in the strip_signature method (around line 728) I replaced the line "if line == '-- ':" with "if line.startswith(self.get_signature_match):".  This resulted in the successful stripping of most signatures as well as old original message info I didn't want to get added on each response.
     25
     26Note: See https://subtrac.sara.nl/oss/email2trac/wiki/Email2tracConfiguration
     27for complete configuration instructions.
     28
     29
     303. email2trac.conf -- Matthew covered this, but might as well mention
     31it again along with a caveat I found related to using email2trac with
     32trac 0.11.  So, important config variables:
     33    [DEFAULT]
     34    project: C:\projects\trac\environmentname
     35    tmpdir: C:\tmp
     36    ticket_update: 1
     37    strip_signature: 1
     38    python_egg_cache: C:\Python25\Scripts
     39    trac_version: 0.11
     40
     41
     42Obviously, if you don't wish to strip signatures, you would set that
     43to 0.  The trac_version variable is important if you're running trac .
     4411 so that you don't receive an error like "str object is not
     45callable".  See https://subtrac.sara.nl/oss/email2trac/ticket/34 for
     46more information about the background of this one.
     47
     48
     494. Making it all work together -- I created a simple batch file that
     50is run by Scheduled Tasks.  All it does is run fetchmail.
     51
     52
     53C:\cygwin\bin\fetchmail -v --fetchmailrc C:/cygwin/path/to/fetchmailrc
     54--logfile c:/projects/email2trac/fetchmail.log
     55
     56
     57Thanks everyone for your responses and hopefully this can help someone
     58in the future!
     59
     60