How to create email filters with KMail

KMail is a feature-rich desktop email client for KDE that is part of the Kontact suite of PIM (Personal Information Management) applications. Last week, we covered email template creation in KMail, and this week, we will continue the series with a look at KMail’s sophisticated filtering system. An email filter allows you to categorize incoming emails based on a plethora of criteria and then assign them attributes, move them, or even reply to them based on those attributes. KMail provides a good deal of options, making it easy to wade through even large volumes of incoming messages.

Setting up filters in KMail is relatively painless, and once you go through our quick examples, you will be well on your way to the cleanest and most efficient mailbox in your home or office. In this example, we will tell KMail to take all emails sent to tavis at maketecheasier.com and automatically move them to a special folder within the Inbox. That way, all MakeTechEasier emails will have their own special folder.

To create a new email filter, start KMail or Kontact and follow these instructions:

4. Select “Match all of the following” or “…any of the following”. The first will check the message for every rule. The second will continue even if it finds only one of the rules.

Below the “match” criteria you will see three columns of drop-down menus. There is theoretically no limit to the number of rows you can add by pressing the “More” button, but for now, we will only work with one row.

The first column tells KMail which field to extract data from (i.e. Subject, To, Message Body), and for this example choose “To”. The second column tells it how to interpret whatever data it finds (i.e. contains, does not contain, is in category). Leave that on “contains” for now. The final column is where you enter the actual words, numbers, and/or characters that you want the filter to find. In this case, it will be my email address: “tavis”, the “at” sign, and “maketecheasier.com”.

In the bottom group box, you should see”Filter Actions”, which determines what the filter will do with the message once it has concluded that it matches the criteria. Among the options are Move into Folder, Mark As, and Forward To. For this example, choose “Move Into Folder”. In the second column, click the browse button with the folder icon to the right of it and select the Inbox. Then, click “New Subfolder”, and name it MakeTechEasier.

At the top, click the “Advanced” tab. Here, you can decide if you want the filter to only apply to certain accounts. You can also apply the filter to sent messages, although this setting is disabled by default. The “Add this filter to the Apply Filter menu” is a very important feature. What it does is allow you to institute retroactive filtering. Let’s suppose you have already received 500 emails from MakeTechEasier. This will allow you to apply your new filter to your inbox. It will scan the inbox and move any emails that match your criteria into your new folder. When you are finished configuring your filter, click “OK”. The new filter will start working immediately on any new incoming messages. If you ever want to add new filters, click the “New filter” button in the bottom left of the settings screen.

With KMail’s filtering system, the possibilities are numerous, and they can even become quite complex. The system allows for regular expressions, numerical data, SPAM filtering, and much more. There is also no real limit to the number of filters you can have, making it not only easy to use but also extremely powerful. Next time you get that newsletter from your professional organization and contemplate dragging it to a folder, consider making a filter so that next time, it will already be there. There are many other types of filters. Test them, experiment, and improve your productivity.

Similar Articles

One comment

nannullsays

I disagree about how people move. Why people move from IE to Firefox? Why people move from Mainframe to PC or regular servers? It it clearly offer benefits and people know about it.

Talk from someone using Linux everywhere from work to home. Linux on the desktop still has compatibility issue to solve with office documents. It still has many issues like Audio even with the latest OpenSuse 11.2. It’s still harder to configure Ethernet or wireless (sometimes, especially corporate wireless security), and many times, you need to use command line, which is great, but not as easy as a GUI.

I recently need to get a serial port remote to work on Linux, and it was seriously hard to do with guide saying rebuilding kernel. I never have to rebuild kernel with the MS OS.

So, don’t deny issues that cause the Linux on Desktop not a realiy today.