It turns out that I was ding it wrong. The mail filter should return the exact same message as it was received including CR/LF endings. After some changes of my code it works.
Kind regards, Martijn On 12/14/2013 04:19 PM, martijn.list wrote: > Hi, > > I'm experimenting with the mail-filter plugin but whenever I add > anything to a message, it always results in an corrupted cache: > > from the logs: > > Dec 14 16:09:55 ciphermail-webmail dovecot: > imap([email protected]): Error: Corrupted index > cache file > /var/vmail/[email protected]/dovecot.index.cache: > Broken physical size for mail UID 76 > Dec 14 16:09:55 ciphermail-webmail dovecot: > imap([email protected]): Error: read() failed: > Invalid argument > Dec 14 16:10:02 ciphermail-webmail dovecot: > imap([email protected]): Error: Cached message size > smaller than expected (773 < 777) > Dec 14 16:10:02 ciphermail-webmail dovecot: > imap([email protected]): Error: Maildir filename has > wrong S value, renamed the file from > /var/vmail/[email protected]/cur/1387033802.M114583P9631.ciphermail-webmail,S=773,W=791:2, > t > > A do-nothing filter that just sends the input to the output works but > whenever I add something trivial to the message, the cache is always > corrupted. > > I using Dovecot 2.2.9.1 (from the deb archives). > > I use the following trivial test to add some XXX chars and and later > remove them. > > In mail-filter.sh I append some chars and in mail-filter-out I filter > these chars out (this is just a test) > > cat > /tmp/dovecot-in.txt > > echo "XXX" >> /tmp/dovecot-in.txt > > cat /tmp/dovecot-in.txt > > mail-filter-out: > > cat > /tmp/dovecot-out.txt > > sed -i /XXX/d /tmp/dovecot-out.txt > > cat /tmp/dovecot-out.txt > > > Any idea what I'm doing wrong? > > Kind regards, > > Martijn Brinkers > -- DJIGZO email encryption
