Click Here to Turn Your Development Passion into a Real Career.

Setup Mozilla Thunderbird to Block all Mail but Local Domain

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.
Setup Mozilla Thunderbird to Block all Mail but Local Domain

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
Speed Up Windows XP Boot and Shutdown Times

Now select the New button to add a new message filter rule
Setup Mozilla Thunderbird to Block all Mail but Local Domain

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.
Setup Mozilla Thunderbird to Block all Mail but Local Domain

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

Setup Mozilla Thunderbird to Block all Mail but Local Domain

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.

Setup Mozilla Thunderbird to Block all Mail but Local Domain

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.

Setup Mozilla Thunderbird to Block all Mail but Local Domain

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

Setup Mozilla Thunderbird to Block all Mail but Local Domain

Now click ok and verify that both filters are set and the check box is marked for enabled.
Setup Mozilla Thunderbird to Block all Mail but Local Domain

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.