Common operations carried out with procmail include filtering and sorting of emails into different folders according to keywords in from, to, subject, text of the mail, or sending autoreplies, but more sophisticated operations are also possible.
A common practice is to let procmail call an external spam filter program, such as SpamAssassin. This method can allow for spam to be filtered or even deleted.
DROPPRIVS=yes
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir/
# Pass mail through spamc, the interface to SpamAssassin
:0fw| /usr/bin/spamc
# Move mail marked as spam to a mailbox named '.Trash/'
:0
* ^X-Spam-Level: ***
.Trash/
:0
* ^X-Spam-Status: Yes
.Trash/
# Move mail from these senders into Lists-Misc
# Empty line is required (this uses a DeMorgan's law OR)
:0
* ! ^Sender: pgsql-hackers-owner@postgresql.org
* ! ^Sender: pgsql-sql-owner@postgresql.org{ }
:0 E:
Lists-Misc