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

View a sample procmail file

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.