Cook Up Powerful Mail-Processing Scripts with Jython Procmail Recipes
Learn how to create Jython Procmail recipes, powerful mail-processing scripts that insert selected values into a database. Their ability to easily hook into existing Java APIs also makes recipes simple to implement.
by Doug Tillman
June 1, 2005
esides its email-processing function, the ubiquitous, open-source Procmail utility can be configured to serve as a local delivery agent for any mail transfer agent (MTA) such as Sendmail and Postfix as well. In this capacity, Procmail essentially acts like a filter that can be configured to process selected messages en route to a destination mailbox. This article demonstrates how easy it is to use Procmail and Jython to implement powerful mail-processing scripts that route mail and parse message contents to insert selected values into a database.
Despite Jython's slight lag behind the C Python and current JDK implementations, it is a robust and stable language that interfaces easily with Java libraries. Jython's command-line interactive interpreter can save you time when trying to figure out how to use an unfamiliar API. It provides instantaneous feedback to method calls so you don't have to code and compile a true Java class. (Click here to read another article I wrote on the benefits of using Jython). These advantages, among many others, make Jython a sensible scripting language choice for creating robust Procmail email processing recipes.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!