Previously, we’ve considered spam suppression features in both
sendmail and Postfix. These features
can be very effective at blocking some spam before it ever enters your
procmail program, written
by Stephen van den Berg, offers a different method for accomplishing
this task. The package’s homepage is http://www.procmail.org.
procmail is a very
powerful, general-purpose mail filtering facility. Its capabilities are
not limited to removing spam;
procmail can be used for several different
To identify spam messages, which can then be discarded or set aside for later examination.
To scan mail for security problems, such as viruses, macros within mail attachments, and so on, allowing you to discard or quarantine suspicious messages.
To sort incoming mail messages by sender, subject area, or any other scheme that makes sense to you.
To reject mail from specific users or sites or with specific characteristics or content (as defined locally); again, such mail can either be discarded or set aside as appropriate.
procmail is the mail
filtering tool of choice for most users on Unix systems.
procmail can be applied to
incoming mail in two main ways: by using it as the local delivery agent (the program to
which the transport agent hands off local messages for actual delivery),
or by piping incoming mail for individual users to it, usually in
the .forward file, as in
this canonical example:
"|IFS=' ' && exec /usr/bin/procmail ...