After changing my email ISP I lost the possibility to filter emails using regular expressions. So I had to find a way to do it on the client side (in my case: in Thunderbird).
Why use regular expressions on emails?
A typical scenario to filter emails using regular expressions is the usage of catch-all email addresses. While this opens the floodgates for spammers (any email sent to WHATEVER@yourdomain.com will be delivered), it can be a convenient way to use special email addresses for special occasions without the need to define email accounts or email aliases each time.
To avoid spam flooding of catch-all email addresses I use a simple strategy:
All email accounts that I use follow a defined naming pattern that is not trivial to guess, so the random accounts that many spammers try to send to can be filtered out.
And this is where regexp patterns come into play:
They provide the means to match the secret pattern in the email addresses and to sort out the random email addresses that spammers tend to use.
How can it be done in Thunderbird?
Many advanced email clients (like Eudora) provide regular expression filters by default. Thunderbird (as of v3.1) unfortunately does not. So I was happy to find that there is a really great add-on that allows not only regexp to be used on the email’s subject and any email header field, but also extends the Thunderbird filter methods by many new convenient rules and actions. This gem is called FiltaQuilla. You can download it from the Mozilla add-on repository.
FiltaQuilla in action!
After installing the extension you can activate all filter actions and search terms that you need in the add-on options (Thunderbird→Tools→Add-ons→FiltaQuilla→Options). These are the options provided by the current version as of this writing (1.1.0):
You will definitely want to have a look at the documentation on the authors website to explore all the possibilities and find out how to use regexp filters and all the other goodies.
Here is a typical example of a (very simple) catch-all email address pattern, that accepts only addresses that contain at least one dot in front of the @. You can also see some exceptions to these rules for senders that are found in the local address book and for legacy addresses that don’t obey the secret pattern.