Advertisement
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 "auto-reply@usps.com" 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement