Routing
Purelymail is extremely flexible with where you can deliver your incoming mail.
There are two main types of routing: account routing rules, and user Sieve filters. Both can accomplish the same thing. The main difference is that an account routing rule runs on any mail addressed to your domain(s); so an email sent to doesnotexist@yourdomain.com could be routed to doesexist@yourdomain.com through an account routing rule. Both account routing (first) and Sieve filters (second) could apply to doesexist@yourdomain.com. If account routing sent doesexist@yourdomain.com to differentplace@yourdomain.com, the Sieve filters for doesexist@yourdomain.com would not run.
Account routing rules 
When mail is delivered to any domain you own, account routing rules can be used to redirect it. They match a specific domain and any of:
- an exact address
- any prefix of an address
- any address except valid user address
- any address (a catch-all rule).
Routing rules apply to all incoming mail for the domain, regardless of whether a corresponding User account exists. This means you can receive mail for infinitely many addresses without creating infinitely many Users.
Routing rules act as a permanent redirect. When a rule is triggered, the email is sent to the new destination instead of the original recipient.
- Redirection: You can redirect mail to any email address, including external accounts. To route to multiple targets, separate email addresses with a comma (e.g. one@test.com, two@test.com).
- Priority: Exact match will always take priority over a prefixmatch, and the longest matching prefix will take priority over other matching prefixes. If a routing rule matches an overlaps an existing User’s address, that User will not receive the email. The routing rule takes precedence and moves the email away from the mailbox.
- Example: If you have a User at me@domain.com but a routing rule for *@domain.com, all mail will follow the rule. The me@domain.com inbox will stay empty.
- Need a copy: If you want to store a copy and redirect the email (or perform more complex actions like dropping mail), use Sieve filters below.
To create an account routing rule, see the routing page in the account management portal.
Sieve filters 
A user's filters trigger when a message enters their inbox. They can be used to send the mail to a specific folder, give it a flag, reject it, or even redirect it based on logic that can inspect the message itself. You can see available filter options and configure them from webmail, under filters.
Remember that you can create a "user" just for the sole purpose of routing their address to another- we don't charge per user!
Account sieve filters 
Account filters use the same Sieve language that webmail filters use internally, and apply to any mail that enters your account, like a routing rule. Currently there is no graphical editor for them, but you can edit them from the Routing rules page in the account management portal.
Symbolic Subaddressing 
If enabled, everything after a symbol character in an email address will be ignored. For example, user+foo@exampledomain.com will be treated as user@exampledomain.com. So will user_foo@exampledomain.com and user_foo+bar@exampledomain.com. Dots will be ignored, so Firstname.LastName@exampledomain.com will route to FirstnameLastname@exampledomain.com.
Note that these alias addresses can be used while logging into webmail and the admin portal, but not via IMAP/POP3.
How do these rules combine? 
Rules apply recursively until the address they're directed to no longer changes. For example, if you have a routing rule that redirects "A@yourdomain.com" to "B@yourdomain.com", and a rule that redirects "B@yourdomain.com" to "C@yourdomain.com", then mail to "A@yourdomain.com" will be delivered to "C@yourdomain.com".
If rules form a loop, they will cut off after a number of redirects.
In short, follow the below steps, restarting at 1 every time the recipient changes.
- Mail is received with an address that your account owns. (You can own either the whole domain or just the specific address.)
- Hardcoded routing rules are applied for the "postmaster" address. We will always receive a copy of emails sent to that address, though you may route them to your own inboxes as well.
- For shared domains and custom domains with Symbolic Subaddressing enabled, the username is rewritten to ignore anything after a symbol. E.g "test_123@test.com" becomes "test@test.com".
- Account Routing Rules are applied
- Account Sieve rules are applied
- User Sieve rules are applied
- Mail is delivered.