How to detect spoof emails using AppleScript on AOL and Hotmail?

Is there an applescript that will peruse an email showing the return path on a suspected spoof email ? User VikingOSX put out here one applescript that does that and it works on my AOL emails but doesn't work on my HOTMAIL emails.



[Re-Titled by Moderator]

Original Title: Detecting spoof emails

iMac 27″, macOS 15.7

Posted on Aug 26, 2026 9:30 AM

Reply
1 reply

Aug 26, 2026 2:12 PM in response to andyfromroseville

Hotmail may be presenting the message headers differently than AOL, so VikingOSX’s script may simply not be finding the same `Return-Path` field.


Before changing the script, I’d open one of the affected Hotmail messages in Apple Mail and choose View > Message > All Headers. You can also add `Return-Path` as a custom header under Mail > Settings > Viewing. Apple specifically supports displaying that field.


If `Return-Path` is present there, but the AppleScript still doesn’t return it, post the script you’re using and, if possible, the relevant header names from one Hotmail message with the addresses removed. That would help narrow down whether Microsoft is using a different header or whether the script needs to parse the raw source differently.

How to detect spoof emails using AppleScript on AOL and Hotmail?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.