Modify stored mail contents?

Evan Martin dovecot-ml at realityexists.net
Sun Jul 23 14:07:05 EEST 2017


It looks like the mail filter plugin 
[https://wiki2.dovecot.org/Plugins/MailFilter] is almost exactly what I 
want, except for this:

 > Currently the filtering must not modify the message in any way: mail 
-> write filter -> read filter -> must produce exactly the original mail 
back.
 > (TODO: Modifying the mail during writing would be possible with some 
code changes.)

Is there any prospect of those code changes being made, so that the 
filter can modify mail contents?

There's no indication in the docs or the code of what would break if the 
contents were modified, but I'm guessing indexes and caches would be out 
of date and would need to be rebuilt? Is it possible to just disable 
those? I don't need high performance.

On 22/07/2017 12:51 PM, Evan Martin wrote:
> Is there a safe way to modify the contents of emails stored by 
> Dovecot? I'll probably only want to change the message bodies, not the 
> headers, if that matters. Looking for ways to do this both for 
> existing emails and new emails as they are received (though anything 
> that works for existing emails can probably just be run again for new 
> emails.) My mail storage is currently mdbox, but I could migrate to 
> another format if that helps.




More information about the dovecot mailing list