I’m writing a junk filtering script attached to Mail.app. I’ve noticed that if I select a received message and hit the “apply rules” contextual menu option, “source of theMsg” will give me FULL raw source of the selected message, including all headers (‘received’ logs, for example). But if I receive a new message in the inbox, “source of theMsg” of my script would only give me the envelope header (To, From, Date, Subj, etc., no “received”)…
To illustrate my point, take this script for example:
using terms from application “Mail”
on perform mail action with messages theMessages for rule theRule
tell application “Mail”
repeat with eachMessage in theMessages
set theContent to source of eachMessage
display dialog theContent
end repeat
end tell
end perform mail action with messages
end using terms from
add it to some rule action, and send yourself a message. Upon receiving message, the dialog pops up, showing only the envelope header and the message body - no mentioning of “Received” parts of the header. However, if you click on the contextual menu option “Apply Rules” on the received message, the dialog pops up with ALL header info + msg body…
Maybe this is relevant - my test was on an IMAP account. So is there a difference between msg on server and msg received?