Advanced email

Back when the Internet was in the hands of professors and scientists, email had its golden years. No spam, no smileys, and certainly no need to have to organise your inbox because there were so few people out there. Of course, that's change - if it's not Nigerians offering you a cut of someone's millions, it's cheap medication, bank phishing scams, or those little images that load remotely using your email address so the spammer knows you've read their trash. Occasionally a real email comes through, but for years now we've been losing the signal-to-noise ratio battle. Fortunately, proper spam control is one of the many features offered by all modern Linux email clients.
Getting started
Choosing your email client is similar to choosing a car: some have more features, some look nicer, but they'll all do the basic job - mail reading, folder organisation, and spam blocking. But the actual amount of functionality provided varies. The stock three email clients that come with most modern distros (we're using Mandriva 2005, formerly Mandrake, here) are Thunderbird, the revamped Mozilla Mail component; Evolution, the Gnome desktop's preferred email application; and Kmail/Kontact. Kmail is unique in that most distros also come with Kontact, which is a unifying application that merges Kmail with KAddressBook, KOrganizer, and various other Ks, giving it equivalent functionality to Evolution. Of the three, Kontact is the most powerful and has virtually every feature you could want, but it's also the hardest to learn because the user interface is a little ragged in places. On the flip side, Thunderbird is very easy to use - think 'Firefox' in terms of styling - but limited in features. In the middle is Evolution, which is only slightly harder to use than Thunderbird, but has many of the missing features. For this tutorial we'll be using Evolution, but see the boxout on the right for information on the other two. The first time you run Evolution, you'll see the Setup Assistant window. Follow the wizard through, and you'll be up and running in no time.
Sheep and goats
The first thing you'll want to do is separate the good emails from the bad so that you don't have to dig through spam yourself. Like many email clients, Evolution uses SpamAssassin for its checks. This is installed by default on many distros. If it's not in your package manager, go here and download the latest .tar.bz2 file (3.0.3 at the time of writing). Once SpamAssassin is installed, restart Evolution. To enable spam protection, select Settings from the Tools menu, then choose the Mail Preferences option from the window that appears. From there, choose the Junk tab, and select both 'Check incoming mail for junk' and 'Include remote tests'. The first option enables SpamAssassin protection for your emails, and also allows Evolution to send data back to SpamAssassin about what emails you marked as spam. The second allows Evolution to go online and read Real-time Black Lists (RBLs) of sites that are known spammers, which is not recommended if you're still on a dial-up modem.
Once spam protection is enabled, you need to start telling Evolution what you consider to be junk. This is a training process: SpamAssassin monitors the words and sender information in your junk emails, and should eventually learn to mark spam for you. Any junk that Evolution finds will be placed in the Junk folder and for the first month or so, you should be looking in here to make sure there are no false positives (real email being marked as junk).
Laying down the rules
Once the spam is dealt with, the next job is to filter your emails so that they get routed to the right place in your email hierarchy. For many people this is just a matter of two or three folders: Internal Mail, External Mail, and Family/Friends are most common, but you can choose the folders you want, and filter email into them.
Evolution uses the VFolder method of sorting mail, which is short for Virtual Folder. This is where you create a folder that is really nothing more than a search query of your inbox: a VFolder holds no mail, but instead holds a set of criteria for mail that should be matched. Therefore, all your emails stay in your Inbox as you would expect, but they also appear in any VFolders you have created that match their search options.
To get started, right-click on the VFolders option in the left-hand pane in Evolution, and select 'New Folder'. This prompts you for a name and location (try 'Has Attachments', and select 'Vfolders' again), then asks you to create the rule that should be used for the VFolder. You'll need to click 'Add' once to add at least one search criteria; change it to 'Attachments', then change the dropdown box next to it to be 'Exist'. The bottom part of the window lets you choose where emails should be sourced from for this folder. Set it to 'With all local and active remote folders' for now. You're done: click 'OK', and your VFolder should appear in the list to the left. If you've yet to grasp how it works, have a look inside and you should see all the emails in all your mail boxes that have attachments. They haven't been moved or copied; the VFolder just searches all the mail boxes for things that match its criteria and links to them. As a result, you can act on the emails all you want from inside the Vfolder, and those changes will take effect in the mail folder, including deleting them.
The real power of VFolders is the 'Create VFolder From Message' submenu of Tools. This lets you select any message and create a VFolder based on the subject, sender, recipients, and mailing list; so you can create a folder 'From Richard' based on an email from one of your friends and have all his email linked in there automatically.
Extra tips
Much of Evolution's magic is trapped within its Settings dialog, but at first the 'magic' may look more like mayhem as you wonder whether the program is just broken! For example, Evolution ships with remote image loading disabled for HTML emails. This is paranoid, but worthwhile: as mentioned earlier, these images often have a unique reference embedded inside them, alerting spammers that your address is active. Evolution blocks this, but you can enable it if you want (Tools | Settings | Mail Preferences | HTML Mail | Always load images from the Internet).
However, there's also a middle ground that loads email pictures if the sender is in your address book; this is essentially a white list for your friends, and as long as your friends aren't spammers in their spare time, you should be fine with that. If you're running SUSE 9.3, the other big advantage to running Evolution is that it links into Beagle, so you can search through your emails at the same time as searching your files, chats, and web browser favourites.
The feature we've left to last, simply because we've never seen anyone actually use it well, is threaded messaging. This groups and indents related emails, ostensibly to make conversations easier to follow. While it's true that conversations are easier to follow when threaded, and really we're not sure we can point to any distinct failing of the feature, we always turn it off anyway. It seems email works best chronologically and that's that. To try it out yourself, press [CTRL]+[T], but that way lies madness.
Evolution isn't everyone's cup of tea, but how do the other two stack up?
Kontact works much like KDE itself: if you want features more than anything else, you'll be in email client heaven. Some of these features are admittedly hard to live without once you're used to them. For example, the message expiration option is essentially an automatic archiver: it tracks the age of messages, and allows you to move them to a different folder once they get past a certain age. Even this option has sub options: how long do you want a message to be considered fresh if it has been read? How long if unread? Do you want them deleted entirely? Should messages you've marked as Important ever be expired?
Perhaps our favourite Kmail feature is 'Enable detection of missing attachments', which searches your email text for the words 'attached' or 'attachment' and warns you if it finds the text, but have nothing attached.If you're using Firefox for your web browser rather than Konqueror, Thunderbird may be more up your street. It uses the XUL cross-platform GUI system like Firefox, and so shares much of the look and feel. It also picks up and uses your GTK theme if you're using Gnome. The Thunderbird interface is neither as refined nor minimal as Firefox's, but it's certainly attractive and easy to learn.
As with Firefox, much of the extraneous functionality has been hived off into extensions available from mozilla.org , but Thunderbird still ships with the most powerful spam blocking around. Unlike the others, it's not based on SpamAssassin. This has the downside of making it ultimately less powerful, but on the flip side it means the Thunderbird configuration options are all laid out for you to tweak to your heart's content, which in our minds places it above SpamAssassin. Thunderbird has the excellent ability to sanitize HTML messages if they have been marked as spam, which is just not available elsewhere.

