Browse DevX
Sign up for e-mail newsletters from DevX


Procmail 'Passthrough' Partners for powerful E-mail Filtering : Page 2

Use this technique to easily 'retrofit' existing e-mail servers.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Arcane and Inflexible
So procmail solves the problem, right? Not entirely. While procmail has the virtues of being fast, widely available, and relatively secure, it's also regarded as intimidating to newcomers.

Moreover, its own "recipe" language for filtering is inextensible; in particular, it has no provision for "attachments" or other modernizations of e-mail, which rely on the Multipurpose Internet Mail Extensions (MIME). Procmail is great for sorting through messages with a subject line of "This is spam," but getting it to segregate only attachments with an extension of .vb has always been regarded as deep wizardry.

Until now. Rather than try to wedge more capabilities into procmail, my approach is to define a recipe which hands over e-mail items to an external processor. The sidebar shows a small but complete example of use of procmail's 'w' flag to pass e-mail through a Tcl filter. I often use the Tcl programming language for such e-mail filters because Tcl is concise, less resource-intensive than competitive scripting languages, easy to learn for other administrators with whom I work, and has good libraries for the kinds of processing I need. However, the passthrough technique is "language-neutral," and I've also employed Python, Perl, Ruby, C, Java, and several less well-known languages. In fact, many of the smallest and fastest filters can be written with just the Unix shell (/bin/*sh).

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date