Add an option to create global mail rules

There should be an option in the mail rules to create global rules. Currently there is only the option for individual mail accounts.


(Originally posted by tigerstrikemedia on GitHub.)

This would definitely be nice. I think the range of actions might be a bit more limited (since Mailspring doesn’t move mail between accounts, you couldn’t create a rule to add a Gmail label to all messages matching a phrase across all accounts, for example). Will see if this can add this the next time mail rules are revisited!


(Originally posted by bengotow on GitHub.)

While contemplating the gold plated global mail rule solution, perhaps a more version 1 friendly feature, would be to enable sharing a rule between accounts of a similar type. So all gmail accounts can share a rule, and all exchange accounts can share a rule etc. - This would enable gmails “Move to label, apply label etc. feature to work” and Exchanges “Move to folder” to work as is today. The actual rules code would continue to operate on the individual accounts, but the user only has to maintain/administer one set of rules for all their gmail accounts?

If a rule could then “Create missing labels/folders” on accounts, that lack a given label - this would be awesome!

Version 2, could introduce variables, so I could create a single rule for all my gmail accounts, "For work, privat and public gmail-accounts, where ends with example.com, apply label “from\example.com{email-prefix}” and mailspring would create the labels for me, if they did not exists in the given account! (ie. the label “from\example.com\john” and “from\example.com\jane”)


(Originally posted by jenschurchill on GitHub.)

The mail rules option should open in a pop out / modal window. Perhaps it would invite too much processing load, but it seems tedious (at least for a new MailSpring user, just starting to create rules) to go back and forth between the inbox, and the preferences.

Also, it’s important to be able to see the messages while creating rules. For example, I might want to create a rule based on an email address and subject contents. I might forget the exact part of the subject or phrasing (e.g. job-hunt vs job hunt). The message at least should be able to be viewed at the same time the rule is created.

Thank you and best regards!

1 Like

If you have a message selected when you open Rules, values from that message can be used to populate the rules fields as you select them. These fields would still be editable, but will give a typo-less initial value.