This is the TkRat mini-HOWTO. This document is geared toward anyone interested in using their Linux computer to send and receive Internet E-Mail.
This document will attempt to describe the following four things:
- Installing the TkRat E-Mail program.
- Downloading mail from an Internet Service Provider.
- Reading, storing, and sending mail
- Sorting the mail into folders
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:
- ftp://ftp.md.chalmers.se/pub/tkrat/tkrat-2.0b3.tar.gz (Download via ftp)
- http://www.dtek.chalmers.se/~maf/ratatosk/tkrat-2.0b3.tar.gz (Download via http)
- http://www.dtek.chalmers.se/~maf/ratatosk/download.html (Download page - check for the latest version!)
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
If anything fails, consult the INSTALL and README files located in the tkrat-2.0b3 directory. Note that you will need a version of tcl that is greater than 8.1 for this to compile. You can obtain the latest tcl from scriptics.com.
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.
- Go the Admin menu, and select Preferences.
- Click on "Sending"
- Enter in your E-Mail address in the "Default Reply-To" field.
- Click on "Apply".
- Click on "Method".
- For "Send Via" select "SMPT".
- In the SMTP host: field, enter the SMPT server address of your ISP (they should be able to provide you with this information).
- Click "Apply", then "Dismiss".
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:
- Click on Admin, then New/Edit Folders
- You will see a box with a "INBOX" folder. Left-Click in that box.
- You are then presented with a menu, so select "New File Folder".
- You'll be given a dialogue box asking for information.
- In the first textbox - enter a name for the folder.
- In the second textbox - enter the filename you will use to store the messages in (Hint: Use something like /home/username/mail/name_of_folder. So, if the first field says "Personal", the second field would say something like "/home/dave/mail/personal" (assuming your username is dave).
- Click OK. You'll notice your new folder is now in the list of folders. So, go to "Window" and then "Close".
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:
Examine the "[Ss]ender" line. You'll notice that that 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:
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:
Now I have a rather nice procmailrc file. Let's examine what procmail will do to each message as it comes in.
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.
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.