Is there a way to enhance Mail.app with better rules?

What I'm missing most is regexps and the ability to group conditions and not only get "If all rules match" or If one rule match"

Alternatively is there a way to use apple-scripts as rules?


I'm not after Junk Mail Filtering

  • 1
    Mark, what are you looking for? This question already has a great accepted answer. – owlswipe Jul 13 '16 at 20:24

There is no way I can think of to use AppleScript to filter messages directly, but I guess you could go the ugly route of redirecting "All Messages" to an AppleScript and then handling them from there back to Mail.app.

==== Update:

To give you a better idea of what I´m talking about, you´ll have to create a new rule with condition "All Messages" and execute an Applescript. For example to check for the subject, you´ll want something similar to this:

using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        tell application "Mail"

            repeat with eachMessage in theMessages
                set theSubject to subject of eachMessage

                if theSubject contains "test" then
                    -- do something here, like move message to a folder
                end if
            end repeat

        end tell
    end perform mail action with messages
end using terms from

Note that of course you could easily use a do shell script statement here to use whatever command line tool you want to compare the subject with a regexp, like if (do shell script "*your regexp that returns 'true' if matched*" ) is true … and so on.


You might try MailActOn. I have not personally tried it, but it has been recommended to me (For the record, the price tag is what stopped me from trying it out). From what I've heard/read, this plugin for Apple Mail might provide you the extra depth you are looking for in managing rules.

There might even be competitors out there as well. But this is the only one I have heard about.

Good luck!

Update: This part of the functionality was what I was referring to. The ability to combine multiple rules (albeit, via key-stroke)

MailActOn Manual

However, you are right. This is probably not what the OP was looking for. This is what happens when you recommend products that you haven't tried :)

  • 1
    Unfortunately, MailActOn doesn´t really add new filter conditions, it only lets you do what its name already tells you: it acts on shortcuts to execute rules (and can handle your outgoing mail, too). – Asmus Mar 4 '11 at 13:19
  • It does allow you to combine rules, which is what I thought might help but in retrospect, I think you are right and the fact that it requires a keystroke is probably a deal breaker. – sorens Mar 4 '11 at 15:36

There is a mail filter rules system called 'sieve' which allows you to go as crazy as you want. Usually this is implemented on the mail server side, and either configured there, or from the mail client using a plugin. While technically not a correct answer, this would be your best bet.

An Apple Mail for OSX plugin exists called SpamSieve which is as the name suggests targeted at filtering mail for spam, but it can be used for mail sorting and organisation just fine.

  • Could you add some links to the tools you are referring to? – nohillside Jul 19 '16 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .