Tags / Email
procmail Notes
I don’t mess with procmail
much anymore, but maybe these will be useful to someone.
Split a mailbox into separate files for each message:
$ formail -s sh -c 'cat - > foo.$FILENO' < klez.file
Resend a mailbox (foo) through a set of filters (rc.test
):
$ formail -s procmail ./rc.test < foo
Move the last 10 messages from folder foo
and put them in folder bar
:
$ MSGS=`egrep '^From ' foo | wc -l`
$ formail +`expr $MSGS - 10` -s < foo > bar
Check which recipes triggered most often (based on a verbose log format):