[Dovecot] Edit an existing message or replacing it

Michael M Slusarz slusarz at curecanti.org
Sun Sep 16 21:55:39 EEST 2012


Quoting Mostafa Rokooie <mostafa.rokooie at gmail.com>:

> I want to know is there any solution to edit an existing message in mailbox
> via IMAP? or replace it with a new message (store a new message with same
> UID)?

You **can't** alter an existing UID message.  You have to re-add the  
message to the mailbox and use a new UID.  For this, you have 2 options:

1.) FETCH the message, alter it locally, APPEND the message to the  
server, and DELETE the original message.
2.) Use CATENATE to create a new message, and DELETE the original  
message (this is how we strip attachments from a message).  Note that  
not all IMAP4rev1 servers support CATENATE.

michael




More information about the dovecot mailing list