Monitoring mail folder and subsubsubfolders

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

Moderator: Mr_Noodle

Monitoring mail folder and subsubsubfolders Thu May 24, 2018 12:44 am • by Davey
I'm pretty much over trying to get mail.app's rules to do anything more complicated than flag a message that meets a rules conditions so I had come up with a plan to have hazel monitor the '/Users/USER/Library/Mail/V5/MAIL_ACCOUNT/INBOX.mbox' folder and it's subfolders for new emlx files. The plan is to have Hazel pass off the new file to an AppleScript and I can handle it all from there.

I created a rule to monitor the dafa folder of the inbox folder of the INBOX.mbox folder

'Kind is Folder > Run Rules on Folder Contents'
and then a second rule that is
'Extension is emlx, Date Added is After Date Last Matched > Display Notification'

just to test it out. I've added and removed 'Continue Adding Rules' in several locations. I've tried 'All Files' and about 300 other variations of both of these over the past many many hours. I've read the few things I could find on processing subfolders.

I've turned on debugging and I can see that Hazel is recognizing that there is a file at path = "/Users/USER/Library/Mail/V5/EBABC370-DA67-4460-928C-944BE26E6B82/INBOX.mbox/C82305AE-767C-4C79-9AD7-46705BC543BD/Data/8/2/2/Messages/228672.emlx" but I can't get it to realize that I want to do something with that file.

Unfortunately I don't think it's possible to monitor a single folder here because the mail app seems to file the emlx files deeply into seemingly random subfolders so they would all need to be covered.

Any thoughts?
Davey
 
Posts: 2
Joined: Thu May 24, 2018 12:25 am

First off, it's a bad idea to have Hazel process the internal files of another application. If you are only doing read-only operations, then it might be ok but moving stuff around, for instance, will screw up Mail.

Go through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Make use of the preview and rule status features to see how things match up.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Monitoring mail folder and subsubsubfolders Thu May 24, 2018 12:21 pm • by Davey
Life is a funny thing. My mother calls me 2-3 times a week with tech issues. The answer is always a reboot.

This time around I had already rebooted while working on this so another reboot was the last thing on my list of possibilities. But in the end a second reboot did the trick. It's currently working as expected.

I'm only reading the files to process tasks in Omnifocus. It grabs the in-reply-to header and searched Omnifocus for a match - when I send an email that I'm waiting for a reply on I copy a separate tasks-only mailbox that creates a task in an Awaiting Reply context along with a link to the message which contains the message id that is later searched for.

This is all extremely unreliable in mail rules so I hope this works with Hazel.
Davey
 
Posts: 2
Joined: Thu May 24, 2018 12:25 am


Return to Support