Setting up procmail for phones etc..

Here is a set of instructions on setting up your account to auto-forward messages on for use with SMS or whatever you want

Set up a .forward file in your home directory

Firstly you need to create a .forward file in your home directory to tell the system to forward all your mail somewhere else, in this case the procmailprogram. (See man procmail for more information). The file should read:

"|/usr/local/bin/procmail USER=yourlogin"
It should include the quotes.

Set up procmail

You must now tell procmail what to do with messages that come in. Create a .procmailrc file in your home directory:
#Set on when debugging     
VERBOSE=off
#Replace `mail' with your mail directory (Pine uses mail)
MAILDIR=$HOME/mail
#Directory for storing procmail log and rc files
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log
DEFAULT=$HOME/.email
INCLUDERC=$PMDIR/rc.rules

Create a .procmail subdirectory

The the above file, you'll see reference to ~/.procmail directory, which you have to create. In this directory, create a file called rc.rules (as specified in the .procmailrc file as being included by it). This specifies the rules to use when forwarding messages:
:0 c
* !^FROM_DAEMON
* !^X-Loop: yourlogin@doc.ic.ac.uk
! email@host.com
This file tells procmail to forward all messages on to email@host.com except those coming from a daemon (such as bounce errors) or those coming from your email address. This stops endless loops of messages happening. You can make this funkier to only forward messages from certain people, or do what I do and exclude certian people's messages from being forwarded. I might add how to do that at a later stage if I can be bothered!

If you want to do that, the man pages for procmailrc or procmailex might help