Procmail Operation

Procmail: filtering application with flexible scripting language

Run at:
User configuration components:
Downsides:
Typical solution: procmail followed by pine

1. If local INBOX, create a default mailbox named mbox (if it doesn't exist):

if  [ ! -f ~/mbox ]  ;  then  :>~/mbox  ;  fi

2. run pine for the first time (if you never did that before in the current account) to create the "mail" directory where the saved mail is going.

3. create a .procmailrc  as following:

MAILDIR =       $HOME/mail
DEFAULT =       $HOME/mbox
LOGFILE =       $HOME/.maillog
LOCKFILE=       $HOME/.lockmail

:0:
* ^Subject:.*Vicodin.*
*
^Subject:.*Refinace.*
/dev/null

:0 B:
* .*Vicodin.*
spam

The directory where mail goes
The default incoming mailbox (local mail only)
The file where the procmail actions are logged
Lockfile

:0 -> Beginning of a recipe
* -> This line contains a regexp to be matched
Another regexp to be ANDed
Where the match goes: delete it!

B -> flag to search the body
.* -> wildcard
File it to the "spam" folder

Sources of inspiration:

<back ... ^up ... next>