Forwarding/Redirecting

To forward all email when it arrives (excluding any email explicitly caught by discard rules, or categorised as spam), click Options, then Define Rules, then the Forward tab. Select 'Always' for the 'Message with' field. Enter the email address to forward to in the 'Forward to' field, leave the 'Forward type' field as 'Redirect message', and choose whether or not to delete the original from FastMail.FM using the checkbox, then click 'Add'.

Of course, you can choose just a subset of messages to forward by selecting criteria in the 'Look in', 'That' and 'The text' columns. Remeber after you add/change/delete any rules, you need to click the 'Apply all changes' button to commit them to the server. NOTE: You should test the operation of this rule after creation. If any previous rule contains a stop (such as in the automatic spam deletion and Junk Mail filing rules), then the forwarding action will not be taken for matching messages (such as spam).

To forward emails *after* you've already received them, select the emails you want to forward on the Mailbox screen, then select 'Redirect' from the Action menu, and type the address to forward to.

'Forward type'

The 'Forward type' column allows you to specify how the message will be sent to the destination specified in the 'Forward to' column. The following types are available:

  • 'Redirect message', the default type, sends an exact copy of the message, leaving the original sender in the From address intact and unchanged to the email address specified in the 'Forward to' field. If you just want to forward the message to another email account, this is probably what you want.

  • 'Redirect summary' extracts the text of the message (i.e., without any attachments or formatting) and sends a notification containing the first 160 characters to the email address specified in the 'Forward to' field. The From address of the summary message is the same as the From address in the original message.

  • 'Redirect squeezed summary' is the same as 'Redirect summary,' except that it uses a compression algorithm to squeeze the text of the message down to a smaller size, while still allowing it to be read. If you would like a (technical) description of the compression algorithm, or to see an example of what compressed text may look like, see this page.

  • 'Forward summary' is similar to 'Redirect summary'; the From address used on the notification email is your default personality, but the subject will be modified to include the sender of the original message.

  • 'Forward squeezed summary' is the same as 'Forward summary', but using the same compression as 'Redirect squeezed summary'.

  • 'Notification only' sends an email to the 'Forward to' address with a message body that says only that a new email has arrived and the From address of the new email.

  • 'SMS summary' is like 'Forward summary' but assumes that the 'Forward to' column will contain a full mobile telephone number (including country code) instead of an email address. It then sends the notification to that phone via SMS. As with all SMS messages, the originator is the Mobile Number of the default personality for the account.

  • 'SMS squeezed summary' is like 'Forward squeezed summary', but expects a mobile telephone number in the 'Forward to' column.

  • 'SMS subject' sends an SMS message containing only the first 160 characters of the subject of the triggering email. The 'Forward to' column must be a full mobile telephone number (including country code).

  • 'Custom' directly inserts the text in the 'Forward to' field into the sieve script. This means you need to include the notify command and all parameters you plan to pass to it. See the sieve documentation for more information. Some examples:

    notify :method "mailto" :options ["joeblogs@hotmail.com","From","Orig"] :message "$from$ / $subject$ / $text$"

    notify :method "sms" :options ["123456789","Squeeze","High"] :message "$from$ / $subject$ / $text$"

If you are using 'SMS summary', 'SMS squeezed summary', or 'SMS subject', ensure that the 'Forward to' column contains a mobile telephone number. You must include the country and area code in the number, and you will need to have purchased enough SMS Credits to pay for the SMS messages that will be sent. For more information on purchasing SMS Credits, see SMS.

Alias forwarding vs. sieve forwarding

To automatically forward messages to another system, there's two main approaches:

  1. Create an Alias or Virtual Alias for the email address you want to forward from, and then set the target of the alias to the email address you want to forward to.
  2. Create a forwarding rule on the Options -> Define Rules screen

The main differences between these two approaches are:

  • The Alias/Virtual Alias forwarding occurs before any of the rules on the Define Rules screen are run. This means all messages sent to the Alias/Virtual Alias will bypass the virus checking, SpamAssassin checking, and your Sieve script.

    The default Sieve script provides backscatter and spam filtering (including whitelisting). Since these features will be bypassed, your "raw" email which is received at FastMail.FM will be copied without filtering to the target. You may view this as good or bad.

    For reference, the FastMail.FM mail delivery process is documented at Email Troubleshooting, Common Questions.

  • The Alias/Virtual Alias forwarding is unconditional. There's no way to only forward emails that only meet a particular criteria, all emails are always forwarded

  • The Alias/Virtual Alias forwarding is only possible on an alias, not email sent to your main account name. If you want to forward email sent to your main account name, you have to use the Define Rules screen.

If these limitations on virus, backscatter, and spam filtering are OK, then you can enter your delivery requirements on the Aliases/Virtual Domain screen for those own-domain aliases you wish to be targeted to external addresses. If you need to target multiple addresses (for example, an external primary, GMail for backup, and your FastMail.FM main account), separate the addresses with a comma. If these limitations are not OK (because you want filtering on all incoming email), you can use the Define Rules > Forwarding screen, which will forward the messages after filtering. You can also combine Virtual Domain targeting and Forwarding Rules.

SMS forwarding part of a message

Sometimes you want to generate an SMS from a message, but the information you're interested in isn't in the first 160 characters of the message. For this case, there's a special syntax you can use to "extract" part of a message to forward as the SMS notification.

You have to use the "Custom" forwarding mechanism as described abose to create a custom notify call.

To forward only the first N characters of a message, you can specify $text[N]$ in the :message parameter. So for instance to forward only the first 50 characters of a message to the mobile number 12345689, you can use:

    notify :method "sms" :options ["123456789"] :message "$from$ / $subject$ / $text[50]$"
    

You can also extract part of a message based on a regular expression to use as the forwarding text. To do that, you use a special construct of the form below before the $text$ parameter.

    extract{{regular-express-with-capturing-()'s}}
    

So for instance, say you receive messages which contain stock quotes, but the messages contain a pre-amble you don't want to forward. You do know that just before the actual quote portion of the email, there is the text "Your stock quote is" and then the actual quote. Using a regular expression, you can capture the text after that string, and forward only it. That would be done with a rule like:

    notify :method "sms" :options ["123456789"]
      :message "$from$ / $subject$ / extract{{Your stock quote is(.*)}} $text[7000]$"
    

The text captured in the (.*) capture is what will be forwarded. Additional notes on using this:

  • Only 1 capture is permitted
  • If the match fails, the entire text part is forwarded still
  • The regexp is in "single-line" mode, so . will match any character, including newlines
  • The regexp is also in "multi-line" mode, so ^ and $ match start and end of line anywhere this is a \n, not just the start and end of the message string
  • Due to limitations in the way notification are done, the total notification text inspected can't be longer 8192 characters, so if the text you want to extra is further than 8k into the message, then this won't work, and there's no way to currently make this work