I want to be able to copy a specific email address from the raw source of email headers in the Mail App. The email address comes after a specific tag such as the auth-sender: email address.
I already can launch Mail app.
Select acct
Select message.
Open raw headers (probably)
What I need help with:
5. But, how do I find and copy the email address in front of a specific tag (i.e. auth-sender:)
6. Pate copied the address in Notes
In my Apple Mail app, I do NOT find any text in the Raw Source that is "auth-sender:" or anything close. But if that is what shows in your Mail Message then it should be easy to extract the email address.
Since you blurred the image where this text occurs in your message, I can't construct the RegEx. You will need to provide the full text around "auth-sender:" that includes the email in order for us to answer your question accurately.
Here is a portion of the text, remember the email address won't always be the same that's why we must find the "auth-sender:" label first, its in bold. I want the email address after auth-sender
Received: from mail pickup service by fakeserver.m2w.com with Microsoft
SMTPSVC; Tue, 3 Dec 2019 14:36:35 -0800
auth-sender: santaana@fakeemail.com
Received: from 217.165.33.125 unverified ([217.165.33.125]) by
mmmeb08oc.m2w.com with M2W SMTP Server;
Tue, 03 Dec 2019 14:36:34 -0800
Date: Wed, 04 Dec 2019 02:32:18 +0400
From: "Coordinador MLV" <santaana@fakeemail.com>
To: <8736c321fd7cc61b92396b4f275614c7@fakeemail.comm>
Since a lot of us are now working from home. I've had to try building this macro again. I've built a macro to find the auth-sender tag in raw within Mail but I can't get it to find the email address using a regular expression auth-sender:\h+(.+)\h*\R*
This is just an example written in response to the below KM Forum Topic. You will need to use as an example and/or change to meet your workflow automation needs.
MACRO SETUP
Carefully review the Release Notes and the Macro Actions
Make sure you understand what the Macro will do.
You are responsible for running the Macro, not me.
==USE AT YOUR OWN RISK==
While I have given this a modest amount of testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
If you have any doubts or questions:
Ask first
Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.
Great job as usual, @JMichaelTX. I just wanted to point out that since this macro involves Mail.app, this can actually be simplified further by using KM's %MailRawSource% token:
Received: from tmsmtp03oc.fakeemail.com (tmsmtp03oc.fakeemail.com [209.67.128.156])
by mlpnf0119.laposte.net (SMTP Server) with ESMTP id 4B7nhm5Ft5zKm40;
Sat, 18 Jul 2020 01:42:00 +0200 (CEST)
Received: from mail pickup service by tmsmtp03oc.fakeemail.com with Microsoft SMTPSVC;
Thu, 16 Jul 2020 07:53:02 -0700
auth-sender: muljavier@fakeemail.com
Received: from 10.1.106.121 unverified ([10.1.106.121]) by tmsmtp03oc.fakeemail.com with M2W SMTP Server;