This explains how to set up a mail
filter to automatically place incoming mail into folders
1. Go to the operating system "$" prompt.
2. Create a file ~/.procmailrc I.e. "cd ; pico .procmailrc"
write the following lines, then exit and save the file:
VERBOSE=off
PMDIR=$HOME/procmail
LOGFILE=$PMDIR/log
MAILDIR=$HOME/mail
INCLUDERC=$PMDIR/rc.folders
2. Make a ~/procmail directory that will hold the logfile and your "recipe"
choices. I.e "mkdir procmail"
3. Create a file ~/procmail/rc.folders I.e. "cd procmail ; pico rc.folders"
enter the following lines, then exit and save the file:
:0:
* ^Subject: test
testing
4. Create a file ~/.forward I.e. "cd ; pico .forward"
enter the following single line, then exit and save the file:
"|IFS=' ' && exec /usr/local/bin/procmail -t -f- || exit 75 #your_id"
[NOTE: replace the your_id with your liberty userid e.g. jsmith
duplicate the punctuation/quotes exactly as given in the line]
5. To make sure that procmail can read the .forward file, do the following:
cd; chmod 644 .forward ; chmod a+x . [that's a trailing period]
6. Mail yourself a couple of test messages, one with "test" as the subject,
and one without "test" in the subject. What should happen is that the
"test" message will be saved in a test folder, and the other message will
be in the default INBOX. If this doesn't happen, then look at the
~/procmail/log file to determine the problem.
7. When the above steps have succeeded, re-edit the file ~/procmail/rc.folders
Delete the test "recipe". Now include whatever recipes you want--you
will probably want to look at the man pages for further instruction e.g.
"man procmail" or "man procmailex".
Examples might be:
:0: # begin a recipe
* ^TOint-law # "*" to begin test, "^TO"=variants of To: field
int-law # what folder file to put messages into
:0: # begin a recipe
* ^From:.*doylej@ # "^"=starts with, ".*"=any characters
junk # what folder file to put messages into
8. Optionally you might want to include the following line at the end of
your file ~/.profile I.e. "cd ; pico .profile"
mailstat $HOME/procmail/log
That will tell you (every time you login) the number of messages that
have been placed in folders since the last time you logged in.