This document is maintained by Dave Whitinger ( email@example.com). Please mail me with any questions or ideas you have regarding this HOWTO.
This document will attempt to describe the following four things:
The document assumes that you are running Linux with the X Window System, have already established a connection to an Internet Service Provider, and have a POP account with that provider.
Disclaimer: All usual disclaimers apply. The author cannot be held responsible for any (mis)use of the information given here. This document does not attempt to be authoritative in any way. The author voluntarily creates this document seperately from any entity with which he may be involved with. By reading this document, you agree to cause the author no grief or trouble. :)
I would like to stress that there are many excellent E-Mail programs available for Linux. It is always a matter of personal preference when selecting which one you will use. That said, I will tell you that I have been using a program called "TkRat" for over 2 years now - and I love it. It's a graphical program that has all the features you would expect from a quality mail program, it's easy to learn how to use, it's powerful, and it's free. For these reasons, I'll only be covering TkRat in this HOWTO.
The first thing you need to do is download TkRat. You can either obtain the sources and compile them, or you can get the binaries.
Here are some URLs for the software:
When you have downloaded the tarfile, you are ready to install it on your system.
To install the tar.gz source, use the commands:
tar -zcvpf tkrat-2.0b3.tar.gz cd tkrat-2.0b3 ./configure make make install
Congratulations - TkRat should now be installed on your system.
In order to read E-Mail, it is usually best to download it using a program called "fetchmail". The following instructions are known to work perfectly for version 2.2 of fetchmail - although they should be applicable to any version.
(Note: Fetchmail is almost certainly already installed on your system, as it is included in all Linux distributions that I know of - if anyone knows this to be untrue, please let me know!).
Perform the following steps:
echo "server pop.com protocol pop3 username dave password foo" > ~/.fetchmailrc (Make sure to replace "pop.com" with the hostname to your ISP's pop server. Replace "dave" with your username, and replace "foo" with your username's password.)
Now, whenever you want to check your E-Mail, just type "fetchmail" at the prompt. Fetchmail will go off and download all your mail and store it in your local mail folder.
>From the prompt, type "tkrat" and press enter. Click on "Create". Read the message it gives you, then click on "Continue". At this point, you are brought to the main TkRat program. The first thing you should do is customize it to your local system.
Upon starting TkRat, You'll notice that you are in a folder called "INBOX". Use fetchmail to download any new mail. If you have any, it will appear in this INBOX folder.
TkRat has an intuitive interface. The top half of the screen is the list of messages you have (Each line is a seperate E-Mail). The bottom half of the screen will be the actual content of the E-Mail.
You can read E-Mails by simply clicking on any message in the list.
When you are finished reading a message, you can move on the next message, reply to that message, compose a new message, or move the message to a different "Folder".
Folders are a way of storing E-Mails into seperate "Folders". This way, you can keep several folders for different topics you may receive E-Mail about.
Perform the following steps to create folders:
You can now Move messages to the new folder - and switch to that folder by selecting the folder's name under the "Folders" menu.
Sending mail is also easy. Click "Compose", type in the recipient's E-Mail address, type in a subject, and then write the message in the body.
When you are finished, click on Send.
If you're like me, you get about 3,500 messages a day. Each time you fetch your mail, you have to wade through all the messages looking for particular ones that interest you.
This is not a problem anymore, thanks to Procmail.
Procmail works like this: Procmail examines each message as it is downloaded, and will perform a series of tasks based upon certain rules that you've specified.
Let's say, for example, that I get about 200 messages every day from a certain mailing list (in this example, I'm using the linux-foo list). Rather than have all those messages go directly into my main inbox, I would rather that they were automatically filtered into a box called "foo-list".
The first step is to take an example mail message that came from that mailing list and examine the mail headers.
I begin to notice a pattern. Every message that comes from that mailing list has a line that says:
I can now tell procmail to place every message that contains this line into a certain folder.
The way I tell this to procmail is by way of a ".procmailrc" file.
I will use my favorite text editor to create a text file in my home directory called ".procmailrc".
The file will look something like this:
LOGFILE=$HOME/.pmlog MAILDIR=$HOME/mail VERBOSE # linux-foo list :0 Hw * ^.*[Ss]ender: firstname.lastname@example.org foo-list # if it got to this point, put it in my new mail folder :0 Hw newmail
Examine the "[Ss]ender" line. You'll notice that the line is the one thing that all messages from that mailing list have in common.
That section is telling procmail that when it sees a message come through with a header that looks like the above, to put it into the "foo-list" folder.
The next section is saying that if the message matched nothing above, to just place it into newmail.
Now, let's say that anytime I get a message from my good friend, EJ, I want it to go into a folder called "EJ".
I'll just create a new section of my procmailrc file. See below:
LOGFILE=$HOME/.pmlog MAILDIR=$HOME/mail VERBOSE # linux-foo list :0 Hw * ^.*[Ss]ender: email@example.com foo-list # Message from E.J.! :0 Hw * ^.*[Ff]rom: firstname.lastname@example.org ej # if it got to this point, put it in my new mail folder :0 Hw newmail
Notice the new section for EJ. When a message comes in with his E-Mail address in the "From" field, it will automatically place it into my "ej" folder.
Now, let's say that there's some lamer out there who keeps on E-Mailing me. I don't want to hear from him, but he's persistent. Once again - procmail to the rescue.
So, let's say I don't ever want to see any mail from Bill Gates. I can setup a recipe to delete any mail that comes from him. Look at my new procmailrc:
LOGFILE=$HOME/.pmlog MAILDIR=$HOME/mail VERBOSE # Is it coming from Bill Gates? If yes, DELETE IT!!! :0 Hw * ^.*[Ff]rom: email@example.com /dev/null # linux-foo list :0 Hw * ^.*[Ss]ender: firstname.lastname@example.org foo-list # Message from EJ! :0 Hw * ^.*[Ff]rom: email@example.com ej # if it got to this point, put it in my new mail folder :0 Hw newmail
Now I have a rather nice procmailrc file. Let's examine what procmail will do to each message as it comes in.
At first, it checks the message to see if it is from "firstname.lastname@example.org". If it is, delete it, and it's done.
If the message made it through the first check, it will see if it has the "email@example.com" in the headers. If it does, it will put it into the "foo-list" folder, and it's done.
If the message still makes it past that, then it checks to see if it's from EJ. If it is, it places it into the "ej" folder.
Now, if the message passes all those tests, then it should just place it into my newmail folder.
Once you have these folders in place and procmail is properly filtering the mail, you can just go into TkRat, "Admin - New/Edit Folder" and create the folders for each filename. They will be located under /home/username/mail/foldername.
This HOWTO is copyright 1998, 1999 by Dave Whitinger, and is a free document. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.
Very special thanks go out to Martin Forsse'n (firstname.lastname@example.org) for authoring the TkRat mail user agent.
Greetings go out to the North Texas Linux User's Group in Dallas, TX, for whom I originally wrote this document back in early 1998. Today no greetings go out to any user groups, as I live in the moutains of East Tennessee, where I believe I am the only Linux user (or computer user, for that matter) within 50 miles.
Also of note: Nic Bernstein has forked the TkRat code to create a mailer called Postilion. It looks like a great mailer with a lot of new features that aren't in TkRat, but, nevertheless, I continue to use TkRat.