Separate imported e-mail attachments for better search

An additional tip: you can run this best on only those e-mails which containt attachments. You can use the selector from Advanced Search (look for Attachments and search for >= 1) or directly use md_attachments>=1 in the search box.

Also note: this script keeps the original e-mails (.eml files) which include the attachments, plus it separates the attachment. This is to keep as much context as possible. I’ve looked into adapting the script to also be able to strip the original attachments, but DT isn’t able to manipulate .eml files. But you can easily do it yourself after the archiving has been done by using a script like GitHub - Conengmo/emailstripper: Strip attachments from local mbox files or parts from here: MailboxCleanup/mailbox_message.py at main · AlexanderWillner/MailboxCleanup · GitHub