Manipulating Your Mail
Incoming and outgoing mail for Bama gets passed around a number of times before the job is done. In this process there are two tools over which you have control and which can help you manage your mail. What else could you do besides read mail and send mail? Lets look at reading mail.
Suppose you get mail from a variety of sources. When new mail arrives you dont know whether it is from an important source which you should answer right away or from one of those pesky mailing lists to which you subscribed that sends you 20 useless messages each day. Sometimes you cant even find that important message buried among the other low priority mail. If you could just sort your mail into different folders automatically you'd be able to find your important messages. The program that will do this is for you is procmail, which delivers your mail on Bama. When it finally comes to deliver the mail to you it looks in your home directory for a file called ".procmailrc" (thats dot procmailrc) from which it will get some rules about the final delivery. Suppose your pesky mailing list always has the address to which it was sent as "To: rockandroll@somemachine.somewhere". You can have procmail always deliver it into a folder called "rockandroll" in a subdirectory of your home directory call "mail" if
MAILDIR = $HOME/mail (check to see that this directory exists and that it is where you want your folders)
:0:
* ^TOrockandroll
rockandroll
All mail to rockandroll will end up in $HOME/mail/rockandroll. The ":0" starts the "rule." Any mail that doesnt match the rule will end up in your default mail directory (usually $HOME/.newmail). You could even create a setup that would grab that urgent message and sort it out separately. Put the name of your important sender in a file in your home directory called ".urgent" (dot urgent). Then put these lines into .procmailrc
URGMATCH=`cat $HOME/.urgent` (note: surround with backwards
quote marks)
:0 B:
* $^From.*${URGMATCH}
urgent
How about sorting out mail that comes to you from a spammer named "jhsmith" (those long, awful messages that sometimes clog up your directory and that you never want to see again). Add these lines onto .procmailrc
:0 ( shift-\ space cat space greater-than-symbol
space slash dev slash null)
* ^From jhsmith*
| cat > /dev/null
The final piece of this puzzle is how you can be notified (if you are logged in to bama) that mail has arrived in one or more of the folders. Add these lines to your ".profile", including only those mail folders about which you want to be notified. If you are using the csh put this into ".login" instead.
MAILPATH=$HOME/.newmail:$HOME/mail/urgent:$HOME/mail/rockandroll
export MAILPATH
biff y
More help on using procmail can be found by using the commands
man procmail
man procmailrc
man procmailex
In sending mail there are several useful options you can use. Those mentioned here are accessed through pine but there are equivalents in other mailers. The first option lets you put a "signature" on the end of every message you send. These signatures are just lines of text that identify who and where you are (and usually some pithy witticism). Put your signature lines in a file in your home directory called ".signature" (dot signature) using any editor you like and pine will pick it up and put in on the end of your mail message when you use pine to compose your letter.
Pine will also let you attach your real name to the "From" line in message headers. By default your name is picked up from the system default but on Bama these names usually look like firstname.lastname and have all lower case or something undesirable. To let pine fix this for you put the following line in a file in your home directory called ".pinerc" (dot pinerc).
personal-name="Your real name"
and your mail headers will have your correct name.
Do you want to use a different editor while writing messages in Pine? You can use vi or emacs instead of the default which is pico. Put the following line in .pinerc
editor=vi (or emacs)
feature-list=enable-alternate-editor-explicitly
Now when you are composing your message text, but after you finish filling in the header information you will get your editor.
All of the special features for pine can be set inside the Setup/Config options starting at the main menu. These features are automatically saved in the .pinerc file.
© 1998, The University of Alabama. The information included here is for the University of Alabama central computing facility as it was configured on the document date. It may or may not apply to other Unix systems.

