[Users] How to save all attachments from all emails in a folder?

Removed GDPR removed-gdpr at example.com
Fri Mar 2 18:43:49 CET 2018


With some digging and a little help from Stackoverflow I think I found
the answer. The command which worked for me is:

export METAMAIL_TMPDIR=/tmp/download; metamail -w -x -q %F > /tmp/export.log

Unfortunately for some reason it works only for 1600 mails. If I select
1601 and try to run the action Claws tells me (sanitized the paste):

---
Could not fork to execute the following command:
export METAMAIL_TMPDIR=/tmp/download; metamail -w -x -q
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/100"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/99"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/98"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/97"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/96"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/95"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/94"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/93"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/92"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/91"
"/home/████/.claws-mail/imapcache/imap.gmail.com/████/DMARC/90"
"/home/████/.claws-mail/imapcache/imap.gmail.c
---

Also:

If my selection contains 1-1236 messages I don't get any dialog.
Everything is exported in a single second.

If my selection contains 1237-1600 messages the export is somewhat
slower (takes a few seconds) and claws shows a dialog (see attached
screenshot).

And for 1601 and above export is impossible as explained.

Another thing:

After finishing the export /tmp/download also contains not only the
attachments but also some files like:

-rw-------  1 ████ users     0 Mar  2 19:19 mm.EcPvNM
-rw-------  1 ████ users   152 Mar  2 19:19 mm.eeiyIh

Opening one of them (non-zero sized) shows me the text of a mail
message. I.e. it seems this extraction also extracts the messages but
not all of them. For example selecting 1000 messages and running the
action gives me:

[/tmp/download]: ls -a *.zip *.gz | wc -l
995
[/tmp/download]: ls -a mm.* | wc -l
384

Perhaps this process could be optimized so that it does not include
these mm.* files and that it works with more than 1600 messages but I
don't know how.



More information about the Users mailing list