CodaMail

Email filtering is a powerful way to organize your inbox and automatically handle incoming messages. CodaMail supports Sieve filters, which you can manage through the Mail Delivery Filters interface in CodaMail.

This guide will help you set up and manage Sieve filters to sort your email, set up auto-replies, and more.

Accessing Sieve Filters

  1. Log in to your webmail account
  2. Click on Settings in the top menu
  3. Select Mail Delivery Filters from the settings menu

Creating a New Filter

To create a new filter:

  1. Click the Create filter button
  2. Give your filter a descriptive name (e.g., "Move Newsletter Emails")
  3. Set the conditions that will trigger the filter
  4. Choose the actions to perform when the filter matches
  5. Consider adding the Stop evaluating rules action as the final step
  6. Save your filter

Filter Conditions

You can set one or more conditions for when your filter should apply:

  • Header - Test against common email headers (From, To, Cc, Subject, etc.)
  • Custom Header - Test against any custom email header
  • Body - Test against message body content with options for text, raw, or specific content types
  • Size - Test if message size is over or under a specific limit
  • Date - Test against date headers in the message
  • Current date - Test against the current date when the filter runs
  • Spam test - Test the spam score level of the message
  • Message - Special tests for message properties (like duplicates)
  • String - Test against string variables (for advanced filters)

For each condition, you can select from various match types:

  • Basic matches: contains, does not contain, is equal to, is not equal to, exists, does not exist
  • Pattern matches: matches expression, does not match expression, matches regex, does not match regex
  • Comparison operators: greater than, less than, equal to (for values and counts)

You can combine multiple conditions using Match all of the following (AND logic) or Match any of the following (OR logic), or simply match All messages.

Filter Actions

When a message matches your conditions, you can choose from these actions:

  • Move message to - File the message in a specific folder
  • Copy message to - Copy the message to a specific folder
  • Redirect message to - Forward the message to another email address
  • Send message copy to - Send a copy of the message to another email address
  • PGP encrypt with key - Encrypt the message using your choice of public PGP key
  • Reply with message - Send an automatic reply
  • Delete message - Delete the message without notification
  • Discard with message - Reject the message with an explanation
  • Keep message in Inbox - Deliver the message to your inbox
  • Set/Add/Remove flags - Mark messages with flags (Read, Deleted, Answered, etc.)
  • Add/Remove header - Modify email headers from messages
  • Set variable - Store values for use in complex filters
  • Send notification - Send a notification when a message matches
  • Stop evaluating rules - Stop processing additional filters

Important: Adding "Stop Evaluating Rules" Action

After setting your actions, it's crucial to add the "Stop evaluating rules" action as the final step in most filters. This tells the system to stop processing other filters once this one has been applied.

Why This Matters

Without a "Stop evaluating rules" action, the system will continue checking the message against other filters, which could lead to:

  • Messages being moved to multiple folders
  • Conflicting actions being applied
  • Unexpected behavior with your email organization

How to Add "Stop Evaluating Rules"

  1. After setting your main action(s) for the filter
  2. Look for the Add action button or link
  3. Select Stop evaluating rules
  4. Make sure this is the final action in your filter

Examples: Creating Common Filters

Example 1: Move Newsletters to a Folder

Name: "Newsletter Filter"
Conditions:
- Match any of the following:
- Subject contains "newsletter"
- From contains "newsletter"
Actions:
- Move message to: "Newsletters"
- Stop evaluating rules

Example 2: PGP Encrypt Messages from a Specific Sender

Name: "Encrypt Sensitive Communications"
Conditions:
- Match all of the following:
- From contains "partner@example.com"
Actions:
- PGP encrypt with key: "your-secure-recipient@example.com"
- Move message to: "Encrypted"
- Stop evaluating rules

Example 3: Flag Important Messages

Name: "Flag Important"
Conditions:
- Match any of the following:
- From contains "boss@company.com"
- Subject contains "urgent"
- Subject contains "important"
Actions:
- Add flags to the message: "Flagged"
- Keep message in Inbox
- Stop evaluating rules

Managing Your Filters

You can:

  • Enable/Disable - Toggle filters on or off without deleting them
  • Edit - Change the conditions or actions of existing filters
  • Delete - Remove filters you no longer need
  • Reorder - Change the order in which filters are applied (filters at the top are processed first)

Filter Order Matters

Filters are processed in order from top to bottom. If a message matches multiple filters and they don't include "Stop evaluating rules" actions, all matching filters will be applied in order.

To change the order:

  1. Click on Filters to see your list of filters
  2. Drag and drop filters to reorder them
  3. Alternatively, you can edit the raw script and reposition rules manually by cutting and pasting
  4. Save your changes

PGP Encryption

CodaMail offers a unique feature to automatically PGP encrypt messages for specific recipients:

  1. Create a filter with your desired conditions
  2. For the action, select PGP encrypt with key
  3. Enter the email address for the public key you want to use to encrypt the message
  4. Consider whether to add the Stop evaluating rules action based on your needs

For PGP encryption to work, the recipient's public key must be in your keyring. You can manage your PGP keys in the settings area.

If you want to PGP encrypt a message and then have later filters perform additional actions (like moving to a folder), do not add the "Stop evaluating rules" action. This allows the message to be encrypted and then processed by subsequent filters.

Vacation Auto-Reply

The Out of Office Auto-Reply feature can be accessed directly from the Settings menu or configured as a filter action:

  • Reply message - The text that will be sent as an auto-reply
  • From - The sender address for your auto-replies
  • Subject - Custom subject line for the auto-reply
  • My email addresses - Which of your addresses should trigger the auto-reply
  • Reply interval - How frequently to send replies to the same sender (days or seconds)

Advanced Features

The Mail Delivery Filters interface also supports:

  • Mail forwarding - Forward or send copies of your messages to other addresses
  • Regular expressions - Use pattern matching for complex filtering
  • Variables - Store and manipulate values for complex filters
  • Header manipulation - Add or remove headers from messages
  • Complex date testing - Filter based on date/time with various components and formats
  • Filter sets - Create and manage multiple sets of filters
  • Custom Sieve scripts - For advanced users, edit the Sieve code directly

Managing Filter Sets

CodaMail allows you to create and manage multiple sets of filters:

  • Create a new filter set - Create a completely new set of filters
  • Activate/Deactivate - Enable or disable an entire set of filters
  • Edit raw - Edit the Sieve script directly for advanced users
  • Delete - Remove an entire filter set

You can create a new filter set by copying from an existing set or uploading a Sieve script file.

Troubleshooting

If your filters aren't working as expected:

  • Check that both the filter and its filter set are enabled
  • Verify that the conditions match what you expect
  • Ensure you've added the Stop evaluating rules action if needed
  • Check the order of your filters (top to bottom processing)
  • Make sure the folders you're filtering to actually exist
  • For PGP encryption, verify that you have the correct public key
  • Check for typos in email addresses and domain names
  • If using regex, test your patterns carefully

Getting Help

If you need additional assistance with filters, please contact helpdesk.

Effective use of email filters can dramatically improve your email experience, but if set up incorrectly can cause you to miss mail that you want.