This is a simple procmail configuration to create a blacklist filter.
The blacklist is saved in the ~/.blacklist.txt
file; each line contains one blacklisted email address (to blacklist domains instead of addresses the rule must be changed; this is not discussed here).
The following content must be placed in ~/.procmailrc
; the first part is configuration and may be altered or omitted according to the context.
PATH=/bin:/usr/bin:/usr/local/bin:/opt/local/bin/:$HOME/bin:$HOME: SENDMAIL=/usr/lib/sendmail SHELL=/bin/sh VERBOSE=off UMASK=077 LOCKTIMEOUT=1024 TIMEOUT=960 SUSPEND=16 LINEBUF=4096 ######################################### # Blacklist recipe ######################################### :0 * ? formail -x"From" -x"From:" -x"Sender:" \ -x"Reply-To:" -x"Return-Path:" -x"To:" \ | egrep -is -f $HOME/.blacklist.txt /dev/null
Source: techrepublic.com