Rick Klint
Rick Klint

Reputation: 3

Applescript for Mail to check if the from email address = the reply email address

I'm trying to create a rule for my incoming email to check if the From email address is the same as the Reply email address. I'm finding that a lot of the SPAM that I am getting could be filtered with this check and I'm not seeing a way to do it with the options that are in Apple Mails rules.

Upvotes: 0

Views: 147

Answers (1)

adayzdone
adayzdone

Reputation: 11238

Try:

using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        tell application "Mail"
            repeat with aMessage in theMessages
                if aMessage's sender = aMessage's reply to then
                    beep
                    --insert your code here
                end if
            end repeat
        end tell
    end perform mail action with messages
end using terms from

Upvotes: 1

Related Questions