Mail rules

Our Settings → Mail rules screen can help you keep your mailbox organized exactly how you like it, without any unwanted messages or spam.

The Mail Rules screen is organized into four sections: Blocked senders, Spam protection, Address actions, and Rules. When a message is received, the way it moves through our system is reflected in this screen from top to bottom: First, we check if the sender is blocked. After that, we check if the message should be marked as spam according to your settings. Next, we check if you have any actions set up for this particular address. Finally, we check how the message should be filtered according to your rules.

Blocked senders

If you receive unwanted messages from the same senders, you can block them. You can also block entire domains so that you don't receive mail from any address at that domain.

Mail sent from blocked senders and domains will automatically be moved to your Trash folder.

Addresses in your Contacts cannot be blocked. If you need to block an address in your Contacts, you will need to remove it from your address book first. (If you do not want to remove the address, you can manually create a rule that moves the sender's messages to Trash.)

You can view and edit your blocked senders anytime by going to your Settings → Mail rules screen, finding the Blocked senders section, and clicking View and edit. On this screen, you'll see a list of any senders you currently have blocked.

If you'd like to add a new sender to this list, type their email address into the field, and click Block.

To block any address from an entire domain, enter the domain only as domain.tld and click Block.

You can also block a sender directly from one of their messages. While viewing the message, click the Actions menu at the top right hand side of the email, then click Block [sender].

Spam protection

You can adjust your spam filtering by going to your Settings → Mail rules screen, finding the Spam protection section, and clicking Advanced settings. On this screen, you'll see a number of options that allow you to customize how your account handles spam.

We offer three options for spam filtering: Standard, Aggressive, and Custom.

  • The Standard option sends messages with a spam score of 5 or higher to your Spam folder.
  • The Aggressive option sends messages with a spam score of 4 or higher to your Spam folder, and permanently deletes messages with a spam score of 10 or higher.
  • The Custom option allows you to select your own spam score thresholds.

More detailed information about spam protection can be found on our Improving spam protection help page.

Address actions

Address actions are applied to all messages sent to a particular email address, before any other rules are applied.

In this section, you can see how many of your email addresses are set to discard, redirected, or moved to a folder/label. To see the specific addresses that are set with a particular address action, click the View button.

If you do not have any address actions set, this section will not appear in your Settings → Mail rules screen.

More detailed information about address actions can be found on our How to set up aliases help page.

Rules

Rules can be used to automatically perform actions on messages that are sent to your mailbox, such as moving certain messages into a folder. Rules can only be created in our web interface, but they will still function if you use a mail client.

A rule consists of two parts: conditions that a message must match, and actions that are taken on the matching message.

Rules are only automatically run on incoming messages. However, when you create a rule, you can choose to apply the rule to any matching messages that are in in your mailbox. Rules cannot be applied to outgoing sent messages.

You can view and edit your rules anytime by going to your Settings → Mail rules screen, then scrolling to the Rules section. Rules are applied in the order they are listed, and they can be reordered by dragging and dropping.

Create a new rule in Settings

You can create a new rule from scratch in your Settings screen by following these steps:

  1. Go to Settings → Mail rules and click Create rule.
  2. On the following screen, you can set conditions for messages that match this rule. Click Add condition to set more conditions as needed.
    • If you're building a rule with more complex needs, you can click Switch to no-preview rules (regular expressions supported). Rules can't be previewed when using this option, and this option is recommended for more advanced users. No-preview rules also cannot be applied to matching messages in your mailbox.
  3. Once you've added your conditions, click Continue.
  4. A new screen will appear showing messages in your mailbox that match your rule's conditions. If everything looks OK, click Create rule.
  5. A new menu will pop up. From here, you can select which actions will be applied to messages that match this rule.
    • If you'd like, you can enter a name for the rule in the Name section to help you remember the rule's purpose.
  6. Once the rule looks good, click Save.

Create a new rule from a message

When reading a message, you can create a new rule that will match future similar messages by following these steps:

  1. While viewing the message, click the Actions menu at the top right hand side of the email, then select the Add rule from message... option.
  2. A pop-up will appear where you can set the conditions that the message must meet for the rule to take effect.
    • We automatically fill in some matching conditions (e.g., the From and To addresses), but you can remove or add conditions as you'd like.
  3. Next, you can select which actions will be applied to messages that match this rule.
    • If you'd like, you can enter a name for the rule in the Name section to help you remember the rule's purpose.
  4. If the rule looks good, click Save.

When you use this option, you will not be able to preview or move any messages currently in your mailbox that match the rule's conditions.

Create a new rule from a search

When searching your mailbox, you can create a rule from your search query by following these steps:

  1. Enter your search terms, then click the Create rule button that appears next to the search bar.
  2. A pop-up will appear where you can set the conditions that the message must meet for the rule to take effect.
    • The conditions will match your search terms exactly. If you want to remove or add conditions, you can do so later by going to your Settings → Mail rules screen and editing the rule.
  3. Next, you can select which actions will be applied to messages that match this rule.
    • If you'd like, you can enter a name for the rule in the Name section to help you remember the rule's purpose.
  4. If the rule looks good, click Save.

Rule conditions

When you take an action on messages, you create a rule that only applies to messages which match a set of conditions.

Conditions can be combined within a single rule. Either:

  • all conditions must be met: condition1 and condition2 and condition3
  • any condition must be met: condition1 or condition2 or condition3

Each condition can examine a different part of a message. For ease, we allow you to set up a rule with some common conditions, such as:

  • From
  • To/Cc/Bcc
  • Subject
  • Body
  • Anywhere

A full list of conditions can be seen when creating a rule.

If you're building a rule with more complex needs, click switch to no-preview rules (regular expressions supported). Rules can't be previewed when using this option, and this option is recommended for more advanced users.

Rule actions

Once the rule's conditions have been met, the rule's actions are applied.

The following actions can be taken on a message:

  • Mark read: Any messages that match these conditions will be marked read.
  • Pin: Any messages that match these conditions will be pinned.
  • Notify me: If you have notifications enabled, you'll receive one for any message that matches these conditions.
  • Move to: Any messages that match these conditions will be moved out of your Inbox and into another folder of your choosing.
  • Snooze until: Any messages that match these conditions will be snoozed and later reappear in your Inbox at a time of your choosing.
  • Send a copy to: If a message matches these conditions, a copy of the message will be sent to the external email addresses of your choosing.
  • Delete to trash: Any messages that match these conditions will go straight to your Trash folder. 
  • Send to spam: Any messages that match these conditions will go straight to your Spam folder. 

Importing and exporting rules

If you'd like to import rules from a Fastmail or Gmail account, you can do so on the Settings → Mail rules screen. To import your rules from another account, click the Import button. On the following page, click Choose a file and then select the JSON or XML file containing the rules you'd like to import.

You can export your account's rules as a JSON file, and later import them into any account that accepts importing rules in JSON format. To download your account's rules into a JSON file, go to the the Settings → Mail rules screen and click Export. Your file will automatically begin downloading.

Information for Pobox users

If you are a former Pobox user, you may be able to recreate your filters through the Settings → Mail rules screen, depending on the filter actions used.

Discard — This filtered the message into your Held Spam screen. The closest equivalent action in Fastmail would be Send to spam, which would send the message to your Spam folder. If you would prefer to discard the message to your Trash folder, you could choose the Delete to trash action instead.

Tag subject — This filter added text to the beginning or end of the message's subject. There is no equivalent action in Fastmail rules.

Push notify — This filter redirected or CCed the message to your pager or mobile device. The closest equivalent action in Fastmail would be Notify me, which would send you a notification on your web browser or Fastmail mobile app.

Save in folder — This filtered the message into a specific folder. The closest equivalent action in Fastmail would be Move to folder or Move to label (depending on whether you have folders or labels enabled in your account).

Send — This filter redirected the message to a specific email address of your choosing. The closest equivalent action in Fastmail would be Send a copy.

Autorespond — This filter sent an automatic response to certain messages. There is no equivalent action in Fastmail rules. You can use the vacation response feature to set up an auto-reply, which can be sent in response to all messages, messages sent from your contacts, or messages sent to a certain email address. If you are an advanced user, you may be able to set up an automatic response to certain messages using Sieve.

Was this article helpful?
85 out of 184 found this helpful