Archiving email automatically using dtpo and hazel

Hello all, I am new to the forum and have been using dtpo for about 6 months and am progressively getting more and more organized.

I have been intensly researching email archiving and I have worked through almost all the issues I had. I did realize after really testing and researching that dtpo does not move the attachments into dtpo, so I thought, well I could use hazel very easily to move the downloads for mail into dtpo, I am fine if it doesn’t link to the message, I can search for it easily.

But I got to thinking, mailboxes are just files, so I am wondering, since there is no automated archiving of email, could I use hazel to setup rules where I can move my mail into dtpo nightly that came in the previous day, so I would always have email passing into dtpo along with the download attachments.

So, does anyone see any issues with this? It kinda seems to go to be true, after there has been so much discussion on archiving email, I feel like I have to be missing something.

One thing I am not clear on is can I send files directly into sub folders and will it be index by dtpo or does it have to go into the inbox to get processed.

Thanks for your thoughts!

Ok, so an update, I got Hazel to work with moving my mail attachments and it seems to work pretty good.
Here is what I did:

I setup Hazel to move all attachments that it finds to a Staging Folder.
Make sure if you do this you set the options in Hazel to Delete Duplicates, one thing I found, since I use IMAP, that if I have the message and I click to open the attachment after its moved, it redownloads it from the server. Having the Delete Duplicates checked will eliminate the chance of creating duplicate files.
Next, I made an Automator Folder Action Script using the:
Set Current Group - Automator Action
Move Items to Current Group - Action

The only downside and its not too much, but I have to keep all the downloads in the staging folder, since that is where the duplication checks happen, I am sure there is a more elegant way around this, but this is the first automator script I have ever done, so its fine for now.

Next is to figure out if this same approach will work with mail files.


Ok, so reporting back, I set this up and let it work on one of my mail accounts overnight and It actually worked almost perfectly, but I notice when I use this method of moving the files I dont get all the same info in DT than when I use the Import email.

Here is an attached screenshot, you will see that the Import Mail Function in DTPO makes the Subject the name of the file, where as the Automator action I made simply has the actual file name of the mail file, which is useless.

Any thoughts around this?

.emlx is a proprietary format introduced by Apple Mail and doesn’t include the attachments. Using the commands “Add to DEVONthink Pro Office” (see Apple Mail’s menus “Message” and “Mailbox”) or File > Import > E-Mail… (see DEVONthink Pro Office) or the “Add message(s)/mailbox(es) to DEVONthink” scripts (see DEVONthink Pro) should include the attachments. Except PowerMail due to a bug/shortcoming of its AppleScript support.