[Dovecot] Is there a hook for a plugin to do some transient operation on the mail body ...

Timo Sirainen tss at iki.fi
Fri Nov 23 08:39:32 EET 2012


On 9.11.2012, at 7.37, Jay wrote:

> ... when the MUA has issued a FETCH?
>  
> I am a Dovecot newbie ... so please bear with me if this is obvious. Basically what I am trying to do is process the mail body (in my own specific way) before Dovecot serves it up to the MUA. I want to do it as a transient operation in memory. So think of the scenario as ...
>   - the MUA issues a FETCH
>   - Dovecot intercepts the FETCH
>   - Dovecot internally gets the mail from the storage into a buffer in memory
>   ----> This is where I'd like to apply a function to the mail body and modify the mail body in the buffer (not in the storage)
>   - Dovecot serves up the (modified) mail to the MUA
>  
> Looking for a hook that allows me to do it using a plugin. Looks like the zlib plugin does something similar ... applies a decompression function ... but I am not 100% sure.

http://dovecot.org/patches/2.1/mail-filter.tar.gz allows you to run it through a script. But note that IMAP protocol requires that messages never change, and Dovecot relies on that internally as well. Practically it's ok enough to change the message content, as long as you don't change the message/MIME structure sizes.




More information about the dovecot mailing list