I have an app that has some interesting "incoming" email features, namely that it has a hyrbid mailing list/web-based forum ala houseoffusion. Ideally, I would write/use an SMTP service that interacts directly with the application's API, but the shortcut was to leverage existing email infrastructure already setup for the project - by polling the mail server every few minutes using CFPOP. Everything went well, the app went into production, and now we realized that we want to handle incoming attachments (which then have their content stripped using java and are indexed for the forum's search - another topic :).

The problem was that with the app in production I couldn't really use the mail servers to test the new attachment-handling features. Rather than duplicate our complicated mail server setup - I needed to setup something locally to test with. Now, I'm sure there are a billion ways to go about this, from postfix & sendmail, IIS, who knows what else - but I'm going to document the route I took because it took me about 10 mintues to have my little mail dev server up and running:

Not many people know about JAMES. It stands for Java Apache Mail Enterprise Server: http://james.apache.org/

I have some familiarity with it because Sakai (another topic) uses a JAMES "mailet" to process incoming email. As I mentioned above, maybe in the future I'll run JAMES in production and write a piece of code (called a "mailet") that talks directly to my app when JAMES recieves mail.

In this case, I just want a simple SMTP/POP3 server, and JAMES can do that well.

  1. Download the binary version http://james.apache.org/download.cgi
  2. Extract the archive
  3. At a command prompt, navigate into the bin folder of the extracted archive and execute run.bat (or run.sh)
  4. JAMES should error out when starting, that's good. No you just need to make some quick changes to the xml config file
  5. Stop JAMES (ctrl-c or close the command prompt)
  6. Edit apps/james/SAR-INF/config.xml
    1. Find the <dnsserver> block and enter the IP of at least one DNS server that JAMES can use
    2. On my system, I had to remove the james-fetchmail.xml entity definition at the top, but I'm not sure why it was erroring out. It's not something I needed in this case so that was fine.
  7. You should now be able to start JAMES (see 3. )  without any exceptions
  8. You can "manage" james via a telnet session
    1. Open a command prompt, type telnet 127.0.0.1 4555
    2. Login using root/root (unless you changed the password in the xml)
    3. You'll have access to a very simple administrative menu to add users and aliases, etc.

That's it - from there JAMES should just *work* (until you close the command prompt). I was able to quickly mimic incoming mail by simply sending mail to account-name@localhost and then fetch it using CFPOP.


09/28/2007 04:25 A - George said...

Thanks on that..I have here some update on Cold Fusion8.0

Adobe have gotten around to releasing their first cumulative hot fix for CF8. The fix wraps up 7 fixes together, these are:

  1. 70110
    Debugger Stepping Issue: When Break on exception was turned on and you stepped over code, variables did not intially show up and an UndefinedVariableException error was thrown. Variables did show up on the second step over of the breakpoint.
  2. 70134
    User CSS Stylesheets: The ColdFusion stylesheets were not consistently imported prior to user specified stylesheets.
  3. 70175
    CFZipParamTag Issue: Only the last entry was used when cfzipparamtag was used in a loop.
  4. 70204
    Cfpdf issue: "Enable Usage Rights" was not working with PDF forms.
  5. 70236
    CreateObject issue: An arrayIndexOutOfBoundsException error was thrown under heavy load when using CreateObject type=component.
  6. 70239
    Cfdocument sizing issue: CFDocument displayed tables with reduced size.
  7. 70261
    JNDI data source issue: Datasources in jrun-resources.xml were not being recognized.Mazda timing belt kit..
Hope, this might help somehow...


Post a comment:

(required, will not be displayed)
 


   You will be sent an email asking you to validate your comment.



Driven by Farcry Open Source CMS. Dressed in Aura.
Powered by ColdFusion MX.