Process a mailbox from command line
formail -s procmail < /var/spool/mail/yourmailbox
Don't do the above, it creates an infinite loop. It will process mail in yourmailbox and send it to the default mail box which is youmailbox. It appends and reprocess' ... etc
For my purposes, I exported the mbox from imap.iu.edu to mbox050628. Then I cp /dev/null /var/spool/mail/user. The default mailbox in .procmailrc was /var/spool/mail/user, so I did a
formail -s procmail < mbox050628
and it filterd unmatched mails to /var/spool/mail/user and the matched ones to wherever they were supposed to go.
By default, procmail uses $HOME/.procmailrc, and /etc/procmailrc as a global rc file. When using formail, to specify another rc file use,
formail -s procmail .another.procmailrc < somembox
[Click to add or edit comments])
Please prepend comments below including a date