Custom filters — Explanation of the message filter fields

The following should be taken into consideration when creating filters:

  • Order matters! The rules are checked one by one, so be sure you have them listed in the order you want them to be checked or executed.
  • Most rules should end with "execute and stop". Only use "execute and continue" if you wish to do multiple actions to a single incoming email.

Visit the (Panel > ‘Mail’ > ‘Message Filters’) page to create a new filter. The following is a list of available fields to add to it.

View the How do I enable message filters on my email address article for further details.

Field Explanation Example

Subject

Looks in the Subject line of the email. It looks everywhere in the subject line, and can match part or all of the Subject.

  • match "drink" in "Subject: Eat, drink, and be merry!"

From

Looks in the From line of the email, checking for who sent the email. It looks everywhere in the From line, and can match part or all of the From line.
  • match "bob" in "From: bob@example.com"
  • match "Jones" in "From: Bob Jones <bob@example.com>"

To

Looks in the To line of the email, checking for whom the email was sent to. It starts searching directly after "To". Use .* before your term to match any part of the name or email address anywhere in the line.
  • match "George" in "To: George of the Jungle <george@example.com>"

Tip: Combine this rule with using '+' for slightly customized email addresses for easy sorting of emails from websites. Give Amazon your email address as you+amazon@example.com and then you can easily filter those emails.

  • match ".*books" in "To: me+books@example.com"

CC

Looks in the CC line(s) of the email, checking for other people the email was sent to. N/A

Headers

Looks at the beginning of every line in the email. Intended for use when matching header lines, such as "X-Spam: Yes". Note that this checks the entire email – the message body and the headers.
  • match "X-Spam: Yes" in the email's headers

Tip: use .* to match anywhere in the line, not just the beginning.

  • match ".*bananas" to match "bananas" anywhere in any line of the email

Reply-To

Looks in the Reply-To line of the email for the email address where replies to the email are sent. N/A

Body

Looks in the message body of the email and does not look in the headers. N/A

Explanation of the ‘Do this’ action option fields

Field Explanation Example

Move it to folder

Puts the email in the specified folder. This is possibly the most useful action, but there are a few caveats/restrictions:

  • The folder must already exist – the filter cannot make the folder for you. If you enter a folder name that does not exist, the emails will be deleted instead of moved.
  • Folder names are cAsE sEnSiTiVe! Double-check your folder name's spelling and shift key usage.
  • The filters cannot use folder names that have spaces in the name. Subfolders are okay, but must be specified with the parent folder and a '.', like ParentFolder.SubFolder. Folder names can only contain only letters, numbers, underscores, dots, and dashes. (But no leading dots, trailing dots, or double dots!)
N/A

Add this to the subject

Adds the specified text to the beginning of the email's subject line. "Subject: Test Email" becomes "Subject: ADDED_TEXT Test Email"

Add this header

Adds the specified text to the header area of the email. This added text will not be visible when the email is displayed normally – it will only be visible when viewing all the headers. N/A

Forward it to email address

What it says. The email address to forward the email to can be any address, hosted at DreamHost or anywhere else. N/A

Forward to shell account

Forward the email to the Maildir of a shell user. This is the same as forwarding to an email address and specifying shell_user@server_name.dreamhost.com. N/A

Delete it

What it says. The email is not put in the Trash folder and is completely erased. N/A

Doing more than one action

Each individual message filter can check for multiple things but can only perform a single action. You can use "execute and continue" to have multiple actions done on a single email. When a filter has "execute and continue" the action from the matching filter is taken, and then the next filter is checked and filtering continues. Normally, filters are made with "execute and stop" and the first rule that matches is the only action taken, and no more filters are checked.

Here's an example set of filters that check for spam and also sort mail into folders:

  • add POSSIBLE SPAM to the subject of emails for any of the following:
-contains viagra in the Subject
-contains diet in the Subject
-contains monkey in the Subject
and then continue
  • move emails to Amazon with Amazon in the Subject
and then stop.
  • move emails to Twitter with twitter.com in the From
and then stop.

A note on the forwarding rule

Forwarding will act very differently depending on the final ‘execute and stop’ or ‘execute and continue’ rule.

For example, a single filter set to:

  • forward and continue – forwards the email, after which a copy is also placed in your inbox.
  • forward and stop – ends the filter chain before it reaches the end, so no message would be placed in your inbox.

Using message filters with Vade spam filters

You can still use the message filters even if the domain is set up with Vade spam filters. Mail is filtered through the spam machines first, then gets routed to the regular incoming mail machines where your filters are then applied.

See also

Did this article answer your questions?

Article last updated .