Zimbra Web Client Mail Filters

Revision as of 17:57, 13 May 2008 by Cfremon (talk | contribs)

Zimbra Web Client (ZWC) Mail Filters are an advanced user feature that allow users to perform actions on incoming email before it reaches their Inbox.

Well constructed mail filters can be used to capture spam that has bypassed spam filters, presort mail into designated folders, to apply tags to mail, to forward select messages.

How Do Filters Work?

Mail filters are a set of user defined conditions that are checked against incoming email. When an incoming email meets any of the user defined conditions, the filter performs user defined actions on the email.

In this section we will first take a look at filter conditions, and then at filter actions.

Filter Conditions

Filter conditions are made of two parts:

  • Comparison Field
  • Comparison Operator

A filter condition is constructed by choosing a comparison field and then choosing a comparison operator and completing any operator fields. These two parts instruct the filter what part of an email to check, and for what content to check.

You can create multiple filter conditions. Using multiple filter conditions help refine filters and allow you to look for very specific types of email. Less filter conditions will create broader filters that can catch a variety of different emails.

Comparison Field

The comparison field tells the ZWC Mail Filter which section of the email to check for the comparison operator. Comparison fields can include the From field, the email body, and even email attachments.

The following table lists and describes all comparison fields supported by ZWC.

Comparison Field Description
From Use this option to specify a From name in an email message.
To Same as From, but looks for the specified names in the To header.
CC Same as From, but looks for the specified names in the Cc header.
Subject Use this to specify a Subject header in an email message.
Header Named When this option is selected, an additional text input field appears before the comparison operator (the contains field). This field allows you to specify any email header. You can specify the standard fields of To, From, Date, Reply-To, or other custom fields that may be included in the message header.

You could use this option to filter out email messages that have malformed headers, meaning they do not contain certain information that is normally considered standard for an email message. Sometimes spam, which is automatically generated, omits information such as the Sender or Reply-To fields. Use the second text field (the field immediately to the right of the compariosn operator) to specify for which header to test.

Size Use this option to select email messages that are larger or smaller than a specified size, including any file attachments. You can use this to discard email messages that are too large.
Date Use this option to specify email messages sent before or after a specified date.
Body Use this option to specify words that are contained or not contained in the Body of the email.
Attachments Use this option to filter for email messages with or without attachments.
Address In Use this option to check if an address appearing in a field of an incoming messages (such as From, To, Cc, and Bcc) is or is not in one of your address books.

Comparison Operator

The comparison operator tells the ZWC Mail Filter what to look for in the comparison field. Comparison operators can include exact matches, email size, and even the existance of an attachment.

The following table lists and describes all comparison operators supported by ZWC.

Note: The available comparison operators vary depending on the comparison field you selected.

Comparison Operator Description
Matches exactly/Does not match exactly Specifies an exact match.

For example, specifying Subject matches exactly Banana would only match Banana and not Bananas or A truck full of banana leaves.

Contains/Does not contain Specifies that the subject line must contain the specified substring.

For example, specifying Subject contains Banana would match I’m going bananas.

Matches wildcard condition/Does not match wildcard condition Specifies that the subject must match the specified string, which includes wildcards.

For example, specifying bana* would match banana and banana tree, but not free bananas. For more information about wildcards, see Using Wildcards in Filters.

Exists/Does not exist Specifies that the specified comparison field must exist or must not exist in the message. This comparison operator is used with the Named Header and Attachment comparison fields.
Under/Not under, Over/Not over Used for comparison against the Size field. When specifying the size to check against, you also specify the unit of measurement: B (bytes), KB (kilobytes), and MB.(megabytes).
Before/Not before, After/Not after Used for comparison against the Date field.
In/Not in Used to check if an address appearing in a field of an incoming messages (such as From, To, Cc, and Bcc) is or is not in one of your address books.

Filter Actions

The filter action tells the ZWC Mail Filter what to do with any email that the matches the filter conditions. You can create multiple filter actions, which are applied in the order listed. Filter actions can include deleting, sorting, and even tagging incoming mail.

The following tables list and describe all single and multiple filter actions supported by ZWC.

Single Action Description
Keep in Inbox Saves email to your Inbox. If none of the filter rules match an email, this action takes place by default.
File into Folder Moves the email to a specified folder.
Discard Deletes the email message without delivering it. The message is not in any of your folders, not even Trash.
Forward To Forwards the email to the address you specify.
Stop Evaluation This action prevents subsequent filter rules from being applied to any message that matches the current one.
Mark Select as Read or Flagged.
Tag with You can tag matching messages with a selected tag.
Multiple Actions Description
Discard If combined with other actions, discard is ignored and the other actions take place.
Stop Evaluation Actions specified after this one are ignored.
File into Folder Multiple File into Folder actions result in multiple copies of the message being stored in different folders. If a specified folder does not exist, the message is saved to the Inbox.
Tag/Mark These actions apply to the message returned from the nearest preceding action. In the case of multiple File into Folder actions, this could result in some copies of the message stored without a tag, and others stored with a tag.
Keep in Inbox Multiple Keep in Inbox actions can be specified, but only one copy of the message is saved to the Inbox.

Using Wildcards in Filters

Wildcards can be used in comparisons that use the Matches wildcard condition/Does not match wildcard contidion comparison operator. The two wildcard characters are * and ?.

Asterisk (*)

The asterisk * is a placeholder for zero or more characters of any type.

Example search string:


Using the above search string would return the following matches:

  • bananafloat
  • bananas
  • banana-leaf casserole float

However, it would not return:

  • super-banana-float

Example search string:


Using the above search string would return the following matches:

  • white bandanna
  • whose bandanna

However, it would not return:

  • whose bandanna is this?

Question mark (?)

The question mark is a placeholder for "exactly one character".

Example search string:


Using the above search string would return the following matches:

  • bananasboat
  • banana-boat
  • banana!boat
  • banana boat

Slash (\)

There may be times that you will want to specify an exact match on a string that contains characters that normally are considered wildcards. For example, you might want to specify a match on a subject line where the main heading is surrounded on both sides by three asterisks, such as:

***MORE MONEY!!!***



To specify a wildcard as itself rather than a substitution for other characters, use the backslash \ immediately before the character. For example the comparison string \*\*\**\*\*\* specifies a subject with three asterisks before and after any string in the middle (including spaces).

The following image shows how you can use both asterisks with slashes and an asterisks as a wildcard to match the above search string examples.


Verified Against: ZCS 5.0.x Date Created: 5/5/2008
Article ID: https://wiki.zimbra.com/index.php?title=Zimbra_Web_Client_Mail_Filters Date Modified: 2008-05-13

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search