This article explains how to create a simple message filter that moves an incoming email to a specific directory. This example is in reference to Vade email filters which is used on all DreamHost accounts.
This example only moves email. It does NOT teach the filters to learn what is and is not spam. To teach the filter to learn what is spam, you must log into atmail and manually tag the message.
If Vade tags a message as SPAM, the headers show the following line:
If the header contains this line, the email is sent to the /Spam folder in atmail. However, if you use an email client such as Thunderbird, you may have your own custom Junk folder. The example below catches an email tagged as SPAM and moves it to your custom IMAP Junk folder named /OLDJUNK.
Creating the custom filter
- Navigate to (Panel > 'Mail' > 'Message Filters').
- To the right of an address, click the Edit button to open the filter page.
- If you have not added filters yet, click the Add New Filter button.
- The add new filter page opens where you can set up a filter:
- Since this example is looking for something in the header, choose 'Headers' and 'contains' from the first two dropdowns.
- The third field is the exact content you're looking for. In this example it's X-VR-STATUS: SPAM.
To ensure you catch the text, add and period and asterix before the code like this: .*texthere
- Choose the radio button 'Move it to folder:'.
- Just under the radio button, type in the name of the folder you wish this email to be sent to.
- When finished creating your rule, click the Add Filter button at the bottom.
What to expect
If an email is sent to you and Vade tags it as SPAM, the message now is sent to your custom IMAP Junk folder. This allows you to continue to view the Spam in the same folder currently set up in your client.