On Linux and other Unix systems, you should use the email infrastructure provided. If you invest time and effort to set up this system, you will gain a huge usability advantage over one-stop-shopping solutions.

Step 1: Fetch Mail

This steps involves contacting the remote mail server, authenticating, asking it for mail, getting them and signing off. If you keep this step, you gain a central point of configuration for whatever comes after this.

The mails are fetched at the remote mail server via POP3 or IMAP protocol and delivered to the local MTA (Mail Transport Agent, step 2) via SMTP.

I use Fetchmail for this, because it's in wide use and straightforward to configure.

Step 2: Transport Mail Locally

This just transports the mail from the local SMTP port to the MDA. MTAs are ugly beasts, and I haven't delved to deep in them. My distribution, SuSE, does most of the work.

This step is nothing glorious, and can in fact be left out. Fetchmail can hand the mail over to the MDA (see below). I keep it as a safeguard against buggy filters: If the filter fails, the mail is kept locally by the MTA.

I use Postfix, because I can actually read the config files.

There is, however, a small Perl program coming with Mail::Audit that replaces Fetchmail and makes the MTA unnecessary (but see Step 6, below).

Step 3: Deliver Mail

No we get to the important stuff. A good MDA (Mail Delivery Agent, also called LDA, Local Delivery Agent) can make the difference between work and fun. Its most important functions are:

Whatever MDA you use, it should be able to write either mbox files or maildirs.

I used Procmail for a while, but while powerful, it has a nasty command language.

More powerful and nicer is Mail::Audit, a Perl module. With it, you can do everything Perl offers: encrypt/decrypt, encode, change, sort, you name it.

If you don't know Perl, you should have a look at Maildrop.

Step 4: Reading Mail

That's the most important thing of course. You can go for looks or for brain, or for both. Whatever you do, make sure your MUA (Mail User Agent) speaks the mbox/maildir that your MDA feeds. With very little work and some thoughts, you can use multiple MUAs on the same mailboxes at the same time.

Step 5: Writing Mail

I use NEdit, you should use whatever editor you are most comfortable with. Again, any work I invest to enhance NEdit's mail writing capabilities can be used with any MUA smart enough to know its limits.

Step 6: Sending Mail

This is usually done with a command line tools like sendmail(1) or postdrop(1). After that, the local MTA takes care of the mail and sends or deferres it as appropriate. One last time: Any work invested here makes the whole system less coupled, because no previous link in the chain has to know anything about it.


mail.html - © 2002 by Thorsten Haude - Most Recent Update 2002-04-20