wiki:Email2tracInstallation/Windows

Version 3 (modified by nicole.swan@…, 15 years ago) (diff)

--

WORK IN PROGRESS

Email2trac on Windows

Using email2trac on Windows requires three components -- A way to receive/gather email, the email2trac script, and a script or batch file that will schedule email2trac to process emails (i.e. automate the process).

Email component

This will vary depending on whether the email server and Trac are on the same server. If they are not on the same server, a way to gather the email is necessary. Two common options are to install the built-in SMTP server or to using an email gathering tool such as Fetchmail.

Built-in Windows SMTP server

Install the SMTP server (NOT the POP server), so that emails are received and left as files in the "drop" folder. This is the way the email server hands off email between the two services. In a way, email2trac performs the distribution functions normally handled by POP. To install the SMTP service via Windows Components:

  • Open Add/Remove? Programs (Start->Control Panel->Add or Remove Programs)
  • Click Add/Remove? Windows Components in the left-hand bar. Use the "Details..." button to drill into Application Server->Internet Information Services (IIS)->SMTP Service.
  • Check the box next to SMTP Service, click "OK", "OK", "Next", "Finish".

If any additional configuration is needed, configuration can be done in the IIS Manager (Start->Control Panel->Admistrative Tools->Internet Information Services (IIS) Manager).

Sample configuration of "Default SMTP Virtual Server":

  • Domain Name: trac-server.domain.com
  • Type: Local (Default)
  • Drop folder: C:\Inetpub\mailroot\Drop (.eml files)
  • Email address: xxx@…

In this configuration, anything sent to the email address with the trac-server subdomain should be automatically forwarded from the email server to the local SMTP server. If your Trac email address is formatted differently or is not forwarded automatically, you will need to configure your main email server to do so.

Fetchmail

Fetchmail requires Cygwin, a Linux-emulation layer, to operate on Windows. Cygwin installation is straight forward as is adding the fetchmail package, but Lifehacker's Introduction to Cygwin and Fetchmail articles are very helpful tutorials for getting Cygwin installed and adding the fetchmail package.

Fetchmail options can be set in the command line or using a .fetchmailrc configuration file, .fetchmailrc. Sample .fetchmailrc file:

poll mail.domain.com with proto IMAP, auth ntlm user "trac@domain.com"
with password "xxx" is trac here options keep
mda "C:/python25/python.exe C:/projects/email2trac/email2trac.py"

.fetchmailrc should be put in a location accessible to fetchmail, such as /home/trac (Cygwin path).

Note that in this setup, email2trac acts as the MDA (or MTA) and automatically processes mail as it is retrieved.

Email2trac Script Setup

Obtain a copy of the script, either by downloading the latest stable source or getting the latest trunk or tagged version. Unlike in a *nix environment, email2trac on Windows does not have to be built or packaged to work. The following files are needed:

  • email2trac.py.in
  • delete_spam.py.in
  • email2trac.conf

Put these files in the directory of your choice, e.g. C:/projects/email2trac. Rename email2trac.py.in to email2trac.py and delete_spam.py.in to delete_spam.py.in. A few edits are necessary for email2trac.py to work in the Windows environment.

  1. (For versions prior to 0.13 only) Comment out the syslog import (approximately line 95 in version 0.10).

#import syslog

  1. Specify the email2trac configuration file path (around line 1060 in version 0.13).
      
     == Process Automation ==
    
    Automation of email processing is dependent upon your email setup.