Advertisement
Guest User

Untitled

a guest
Aug 28th, 2019
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using terms from application "Mail"
  2.     on perform mail action with messages matchingMessages for rule theRule
  3.         repeat with newMessage in matchingMessages
  4.             set msgMailbox to the mailbox of newMessage
  5.             set msgAccount to the account of msgMailbox
  6.             set subj to newMessage's subject
  7.             if subj contains "Item Delivered" or subj contains "Expected Delivery" then
  8.                 set trackNum to the last word of subj
  9.                 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
  10.             end if
  11.         end repeat
  12.     end perform mail action with messages
  13. end using terms from
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement