renaming eml file with mail sender

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

renaming eml file with mail sender Thu Jan 02, 2020 5:35 am • by tsolignani
Hallo everybody.

Love Hazel.

I would like to rename eml files (Apple mail mails) dragged to the desktop according to the following pattern:

date - sender

For the date, I already managed with custom pattern. Hazel matches, retrieves the date and put it into the new file name.

I wonder how I could retrieve the mail sender.

Maybe anyone did something similar?

Thank you.

Tiziano
tsolignani
 
Posts: 7
Joined: Sat Dec 29, 2012 11:13 am

Re: renaming eml file with mail sender Thu Jan 02, 2020 12:05 pm • by Mr_Noodle
You should be able to use a pattern for that as well, though it depends on which field ("from", "reply-to", etc.). Also, not sure if you want the email address or the person's name, which may not actually be there.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: renaming eml file with mail sender Tue Jan 07, 2020 6:00 am • by tsolignani
Thank you.

As a matter of fact, I managed to build a pattern for the email «coming» address as well, but not relating to the «from» field or header, I just built a pattern for something with the same syntax of an email address and told Hazel to get the second occurence of that.

It turned out it works.

But say I would like to build a pattern to found any string after, say, a «from:» field or heard, how should I do that?

Thank you.
tsolignani
 
Posts: 7
Joined: Sat Dec 29, 2012 11:13 am

Re: renaming eml file with mail sender Tue Jan 07, 2020 12:57 pm • by Mr_Noodle
Just do something like:
Code: Select all
    From: <<<whatever pattern you have to match email addresses>>>

I wouldn't count on the 2nd occurrence as there's no guarantee that it will be the second one and there are other fields that are email addresses that are not the from field.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron