[Dovecot] Proprietary mail storage.

Timo Sirainen tss at iki.fi
Wed Aug 31 18:14:57 EEST 2011

On 31.8.2011, at 18.04, Robert Schetterer wrote:

>> Is it otherwise a Maildir? If yes, you could base your code on the zlib plugin, or perhaps more easily you could use mail-filter plugin: http://dovecot.org/patches/2.0/mail-filter.tar.gz
> are there any examples or how too online for mail-filter ?

For compiling look at the beginning of mail-filter-plugin.c

For using add it to mail_plugins and:

plugin {
  mail_filter_executable = /path/to/your/script.sh

A script could be for example (totally insecure and broken):


sed s/Hello/Hi/ > /tmp/foo
cat /tmp/foo
rm /tmp/foo

Unfortunately you can't both read stdin and write to stdout at the same time because of some internal Dovecot problems with it. So you'll have to write it to a temp file and then output that after the entire input is read.

More information about the dovecot mailing list