Email Filters

An email filter sorts and redirects incoming emails according to certain criteria that you specify to determine how to handle email messages.
The system uses the mail server Dovecot and the plugin Sieve. You can install them in SettingsFeatures.


Step 1. Create a mail filter

    .1Go to Accounts Mailboxes
    .2 menu → Filter settings Add.
    .3Enter the Email filter name.
    .4In the Place before field select a condition.
    .5To set an action that will be applied to all emails:
    .aIn the Operator field select "Without rules".
    .bClick on Next and go to  Step 3 .
    .6To set the conditions when the filter will be applied:
    .aIn the Operator field select: "All are true" — the filter will be applied if all conditions are met; "At least one is true" — the filter will be applied if at least one condition is met.
    .bClick on Next and go to  Step 2 .

Step 2. Filter rules

Select Rule 1 and add parameters. Set other rules and click on Next.
"Sender", "sender or recipient", "recipient", "message body", "message header"
    .1Select an Operator to check the parameter:
  • equals — the email exactly matches a defined value;
  • contains — the email parameter contains a text that you defined in Value;
  • matches regex — the email parameter matches a regular expression that you define in Value.
    .2Enter one or several Values that will be compared with the email parameter.
    .3Check the Not box to enable the converse condition.

"Size"

    .1Select an Operator to check the parameter: "greater" or "less".
    .2Enter the email Size (Kb).

"Message header"

    .1Enter the message header in the Parameter value field. You can enter several values space-separated.
    .2Select an Operator to check the parameter:
  • equals — the email exactly matches a defined value;
  • contains — the email parameter contains a text that you defined in Value;
  • matches regex — the email parameter matches a regular expression that you define in Value.
    .3Enter one or several Values that will be compared with the email parameter.
    .4Check the Not box to enable the converse condition.

Step 3. Filter actions

When an email matches your filter, the control panel will apply one of the actions that you specify:
Select Action 1 and enter its parameters. Add as many actions as you need and click on Finish.

"Save a copy"

In Action 2 select where you want to save the email copy:
  • redirect — the email copy will be redirected to the mailbox specified in the Value field;
  • save to folder — the email will be saved in the specified Directory. Select "New directory" to create a new one and enter its Name.

"delete"

The email will be deleted.

"deny"

The email will be rejected. Enter a response to the email sender in the Value field.

"redirect"

The email copy will be sent to the specified mailbox. Enter the recipient's email address in the Value field.

"save to folder"

The ticket will be saved to the specified Directory. Or you can create a "New directory" and enter the New directory name.
Details
Email filtering rules are saved in the directory /var/www//data/email///. The .dovecot.sieve file for every email filter will contain the following record:
include:personal "<Mail filter name>";
Email filtering parameters are specified in the .sieve/ .sieve file.Learn more in the Dovecot documentation.