Procmail is a free opensource package that can automatically process messages as soon as they arrive. This guide will only attempt to inform one how to forward mail to other folders - hence lead one to having a very organised mailbox.
For the purpose of this guide, the RedHat Linux 6.0 distrubution is the choice (6.0 an up will work fine, since a .forward file doesn't need to exist). Hence, you will need to have you mail messages delivered to a Linux (Unix is fine) system that:
Now, the procmail primer can begin!
# Upon debugging, you want verbose, you make it yes VERBOSE=no # Upon debugging remove the # # LOGABSTRACT=all # Replace $HOME/mail with whatever it is your mail directory is MAILDIR=$HOME/mail # This is the default for pine # Directory for storing procmail items PMDIR=$HOME/Procmail # Create this directory on your system for recipe files LOGFILE=$PMDIR/log INCLUDERC=$PMDIR/test.rc INCLUDERC=$PMDIR/lists.rc
:0: * ^Subject:.*testing testingNote that the first line is a zero (0), not an O.
:0: * ^TO_myoss@my-opensource.org list-myossThe above recipe puts all messages sent to firstname.lastname@example.org into a folder called list-myoss in ~/mail (as defined in your .procmailrc file). Here are some notations to utilise in your recipe files.
|:0||Begin a recipe|
|:0:||Begin a recipe and use a lock file (this will help prevent mail handling errors)|
|*||Begin a condition|
|^TO_||Look for a header that begins with To: or Cc:, followed by an e-mail address that has a string|
|email@example.com||The said mailing list|
|list-myoss||If a match exists, the mail is moved over to this folder|
Note: As a tip, it is advised that the busiest of mailing lists be placed on the top of your lists.rc file - this helps it process faster, saving your CPU cycles.
That should actually fix everything that you wanted. Now, all mailing lists will be sorted, and you can finally get your mailbox to yourself. This setup works especially well when you start fetching mail from various accounts, like when you use fetchmail (read Getting fetchmail to work with IMail to see what kind of setup I utilise).