[Dovecot] doveadm fetch LARGE attachments and remove message [SOLVED]

Bradley Giesbrecht bradley.giesbrecht at gmail.com
Tue Jun 19 16:51:06 EEST 2012

On Jun 18, 2012, at 6:49 AM, Timo Sirainen wrote:

> On 17.6.2012, at 18.19, Bradley Giesbrecht wrote:
>> Looking at the wiki and man pages I am unsure how to fetch email attachments from a unix shell.
>> I have an "doveadm search" that returns the messages that have the attachments I am after.
>> Would I loop through an "doveadm fetch" and use a commandline imap client to save the attachments and move the message to the Trash?
>> Or is there a doveadm command for this?
> No, there's currently no easy way to do this. doveadm fetch doesn't support that. You could possibly do this via IMAP, but it would be difficult to know which MIME part to fetch. Actually it's not even obvious if a MIME part is an attachment or not..

I used an imap client to create an imap folder named "unpack" , searched for the messages I needed and then moved them into the unpack folder. I then used munpack to unpack the messages from the unpack folder to a local disk directory.

Bradley Giesbrecht (pixilla)

More information about the dovecot mailing list