On 23 Jul 2017, at 16.14, Tom Hendrikx <tom@whyscream.net> wrote:
In general, you should not do this. When a message is stored using IMAP, it is immutable. The IMAP server also remembers things like size and assigns messages a unique ID, so mail readers that have already downloaded the message with that ID, don't have to download the whole message again to verify whether it's contents have magically changed. What you're suggesting is not simply compatible with IMAP standards.
The normal way of applying changes to messages is just like a mail client connecting to IMAP: create a new message and save it to the store, then delete the old one.
Just like that. But instead of using IMAP interface to do it, you can also do it with doveadm:
- doveadm fetch mail
- doveadm delete mail
- modify fetched mail
- doveadm import modified mail back
Simple as that. There is no other supported way to do it. Editing mail objects on storage will break things.
Sami