Constrictor Mail Filter 0.3

Constrictor is a Python module for parsing, filtering, and delivering mail as a mail delivery agent (like Procmail).

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
BSD License 
Daniel Margolis
ROOT \ Communications \ Email Filters
Constrictor is a Python module for parsing, filtering, and delivering mail as a Mail Delivery Agent (like Procmail). Constrictor provides the functionality to easily write a MDA in Python rather than reading some configuration file of its own syntax.

This has the advantages that configurations are readable and self-explanatory (at least, to anyone who knows Python) and that users have the full flexibility of the Python language at their disposal. Constrictor has the ability to deliver to maildir and Unix mbox format mailboxes, as well as bounce, forward, or reject messages.

Constrictor is currently beta software, at best. I'm always very leery of software that messes with my mail, since one runs the risk of not only losing messages but, potentially, bouncing mail to great embarassment and chagrin. That said, I am currently using Constrictor on my own mailbox full-time, but, as always, your mileage may vary.


Constrictor is a single Python module that should be placed either in the directory you intend to invoke your MDA from, or in your Python library directory. The only non-standard module it relies on is the spamd module from the SpamAssassin distribution (available at, and only then if you intend to use the "spamassassin()" function to filter your mail (the module is loaded only when that function is called). Constrictor should work on all versions of Python greater than 2.3; it has been tested primarily on 2.3.4, 2.3.5, 2.4.1.

The spamassassin() function connects to a (optionally specified) spamd server (it defaults to localhost). If you do not have a spamd server, you cannot use this function.

For Postfix and Sendmail, edit your ~/.forward to include "|/path/to/". For more information on invoking this script as an MDA,see your MTA's manual or ask your administrator.

What's New in This Release:

This release adds locking code to duplicate database (pickle file used to recognize duplicate messages) access.
This release contains no known stability or delivery reliability issues, and thus is considered stable.

Last updated on November 28th, 2005

#mail filter #parsing mail #delivering mail #Constrictor #mail #filter #e-mail

Add your review!