Testing procmail
The desired rules in .procmailrc can be run on an alternate mailbox for testing as follows:
- Do not enter the lines in ~/.forward.
- Test to see whether procmail is present on your machine (which should be
the case for our Linux systems):
procmail -v
If it is not present on your Linux system please notify us. - Make sure that the following line is present at the top of your .procmailrc:
DEFAULT=/tmp/inbox.out
This line should be removed after testing! - cp $MAIL /tmp/inbox
- formail -s procmail < /tmp/inbox
Do not use /tmp for anything else than testing your rules interactively; when running rules in production they are usually ran on the mailserver which might not have as much space in /tmp as you would like.
You can view the results of the run by running the following commands:
- mutt -f $HOME/Mail/SPAM
- grep Level: $HOME/Mail/SPAM
- mutt -f /tmp/inbox.out
- grep Level: /tmp/inbox.out
The file inbox.out contains your inbox as it would have been after the use of procmail on your mailbox.