Page 1 of 1
renaming eml file with mail sender

Posted:
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
Re: renaming eml file with mail sender

Posted:
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.
Re: renaming eml file with mail sender

Posted:
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.
Re: renaming eml file with mail sender

Posted:
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.