Filter mail

Actions

SmartSieve can automatically carry out any of the following actions to a specific type of email that is sent to your account:

  • file it into a specific mailbox/ folder
  • forward to another mail address
  • send a reject message to the recipient
  • discard the message

Identifying which messages to apply actions to

In order to carry out any of the above actions, SmartSieve needs to know how to identify the relevant messages. It can identify them by any or all of the following:

  • if message 'From:' contains: (text or mail address you specify)
  • if message 'To:' contains: (text or mail address you specify)
  • if message 'Subject:' contains: (text you specify)
  • if message size is less than greater or than (size you specify) KiloBytes
  • if mail header: (email header you specify) contains: (text or mail address you specify)

Advanced users can also apply customised rules and multiple rules.

To add a new filter rule:

  • log into SmartSieve from the SmartSieve logon page (https://webmail.bris.ac.uk/smartsieve/login.php), using the instructions on the Logging into SmartSieve page
  • click the 'New filter rule' link at the top of the page
  • complete the checkboxes, conditions and actions sections as described below:

Checkboxes

There are checkboxes at the top of the page:

Checkboxes

Description

Check messages against next rule also Select this check box if you want the message to be tested against other rules after this one has been applied.
Useful if you want more than one rule applied to a message - keeping one copy of the message filtered into a subfolder, and another copy forwarded to a different email address, for instance.
Keep a copy of the message in your Inbox Select this check box if you want a copy of the message delivered to your Inbox as well as performing the specified action (such as filing it in a specified folder).
Use regular expressions Select this check box if you wish to use regular expressions in your rules (technical users only).

Back to top

Conditions

The 'Conditions' section is used to specify which messages this rule is applied to.

Use the 'From:' 'To:' 'Subject:' and size fields to restrict the rule to messages with specific senders, recipients, subject lines or sizes.

Screenshot of new filter rule conditions box
Screenshot: new filter rule conditions box

The 'If mail header:' condition is used to apply conditions to other email headers; for example:

Screenshot of new filter rule conditions box with SPAM level
Screenshot: new filter rule conditions box with SPAM level

'If mail header: X-SPAM-LEVEL contains +++++' means the rule will be applied to messages which the spam filters have given a score of 5 or above.

Back to top

Actions

The 'Actions' section specifies what action to perform on messages that match the conditions in the 'Condition' section above.

Screenshot of new filter rule actions
Screenshot: new filter rule actions box

 

Action

Description

File Into: Used to automatically file the message into a specific folder. Select the target folder from the pull-down list.
Forward to address: Used to forward the message to another email address
Send a reject message Used to reject a message. The sender is sent a copy of the message in the text box on the right, and the message is discarded.
Discard message Silently discards the message

Back to top

When you've finished editing a rule, click 'Save changes' to save it.

Whitelisting email.

Sometimes you may find legitimate email is marked as spam and filed into your possiblespam folder. You can use SmartSieve to whitelist this mail; simply create a rule with the Action 'File Into: Inbox'

screenshot of SmartSieve whitelisting email

 

Custom filtering rule

It is also possible to write a custom filtering rule in the 'Custom Rule' box. This is only recommended for advanced users who know something of the Sieve language - stay away from it unless you're feeling brave!

Example:

To create an auto response and discard all incoming email add the following custom rule, changing the two email addresses, the Mailname address (A.N.Other@bristol.ac.uk) and the username address (xxano@bristol.ac.uk).

if not header :contains "X-Spam-Flag" "Yes"  {
    vacation :days 1 :addresses ["A.N.Other@bristol.ac.uk", "xxano@bristol.ac.uk"] text:
I am away on maternity leave and will not receive or respond to emails.
Regards,
A N Other.
.
;}
discard;

This will send a vacation like response to any email that has a spam score of less than 5.0 and delete all newly delivered email, spam or not.

Back to top