Page 1 of 1

Move DMARC files into matching domain subdirectory/folder

PostPosted: Tue Feb 07, 2023 10:06 pm
by ewagar
I have several domains which I receive report emails with attachments where those attachments are auto removed and saved into a folder/directory on google drive.

The attachment name format is:
<reporting domain>!<domain being reported>!<some number 1>!<some number 2>.xml.gz
<reporting domain>!<domain being reported>!<some number 1>!<some number 2>.zip
<reporting domain>!<domain being reported>!<some number 1>!<some number 2>!<some number3>.json.gz
example:
google.com!ullec.xyz!1675641600!1675727999.xml.gz

I manually move these files every couple of days from the top-level directory into their respective domain-name directory. So, in the above example, I'd move that file into the ullec.xyz sub-directory.

How can I get Hazel to do this for me?

Re: Move DMARC files into matching domain subdirectory/folde

PostPosted: Wed Feb 08, 2023 10:43 am
by Mr_Noodle
Look up match patterns in the manual. You can set up a pattern with a custom attribute to grab the second part. You can then use that custom attribute in a Rename or Sort into subfolder pattern.

Re: Move DMARC files into matching domain subdirectory/folde

PostPosted: Thu Feb 09, 2023 2:48 pm
by ewagar
I create a rule with 2 conditions:
(1) Kind is not folder
(2) Name matches <anything><A Custom List of Domains><anything>
with an action of:
Sort into subfolder with pattern <A Custom List of Domains>

I also ran into a bug while editing the domains list. I'll submit via the contact.