a guest Aug 28th, 2019 237 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- using terms from application "Mail"
- on perform mail action with messages matchingMessages for rule theRule
- repeat with newMessage in matchingMessages
- set msgMailbox to the mailbox of newMessage
- set msgAccount to the account of msgMailbox
- set subj to newMessage's subject
- if subj contains "Item Delivered" or subj contains "Expected Delivery" then
- set trackNum to the last word of subj
- set (the mailbox of every message in msgMailbox whose sender contains "firstname.lastname@example.org" and subject contains trackNum and date sent is less than newMessage's date sent and deleted status is false) to mailbox "Trash" of msgAccount
- end if
- end repeat
- end perform mail action with messages
- end using terms from
RAW Paste Data