In this tutorial you will learn how to setup Mozilla Thunderbird to delete all mail that is not sent from your local domain. This will also help you learn how to set filters for other uses.
First we have to have a way to filter the mail, without downloading the entire message. Downloading the entire message will still allow viruses to get to the PC, so we will download only the headers of the message.
On the menu bar go to:
Tools – Accounts – Server Settings and Check the box the says “Fetch headers only” then select OK.
Now we need to setup our mail filters to block all domains but our local domain. On the menu bar go to Tools – Message Filters
Now select the New button to add a new message filter rule
We will now set our mail client to only download messages from our domain, which is test.com for the purpose of this tutorial. So in the Filter Name field we will enter “Download Mail from test.com”, so we will know what this filter is later. Then under the “Incoming Messages that:” Section we will select the “Match all of the following” option.
To download the mail from test.com we will set the filter under the “For incoming messages that:” section to:
From | contains | @test.com
And the “Perform these actions:” section to:
Fetch from pop server
Click ok to save the settings
Remember we only downloaded the header of the message. This rule will tell Thunderbird to download the rest of the message for all mail from test.com.
Now we will need to deal with the mail that we don”t want to receive. We will have Thunderbird delete these messages, so we need to create a new rule.
We will call this rule “Delete all other messages”. We will also select the “Match all of the following” option.
This time we will set the rule “For incoming messages” to:
From | Doesn”t Contain | @test.com
And change the “Perform these actions” to:
Delete from pop server
Now click ok and verify that both filters are set and the check box is marked for enabled.
Now you can close the window and test your configuration. The way that I test is to send a message to the email account I set the filters on from two different email accounts. One of the accounts should be let through because it will be in my domain. The other should be deleted from the pop server before hitting my PC. I will usually verify that the mail is in my inbox by checking the email through the web based service first. Then I will click the get mail button in Thunderbird and see if the files are downloaded. You may also notice that Thunderbird will say downloading message 1 of 2, but it will only download 1 message to the inbox.
Johnathan Ward is an experienced developer and consultant that writes tutorials to help other developers. In his day job, he is an IBM Watson Consultant with several years of experience deploying and customizing Watson Explorer solutions.