martijn.list
2013-Dec-14 15:19 UTC
[Dovecot] mail-filter always results in corrupted indexes
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(martijn=djigzo.com at ciphermail.private): Error: Corrupted index cache file /var/vmail/martijn=djigzo.com at ciphermail.private/dovecot.index.cache: Broken physical size for mail UID 76 Dec 14 16:09:55 ciphermail-webmail dovecot: imap(martijn=djigzo.com at ciphermail.private): Error: read() failed: Invalid argument Dec 14 16:10:02 ciphermail-webmail dovecot: imap(martijn=djigzo.com at ciphermail.private): Error: Cached message size smaller than expected (773 < 777) Dec 14 16:10:02 ciphermail-webmail dovecot: imap(martijn=djigzo.com at ciphermail.private): Error: Maildir filename has wrong S value, renamed the file from /var/vmail/martijn=djigzo.com at ciphermail.private/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
Timo Sirainen
2013-Dec-14 15:21 UTC
[Dovecot] mail-filter always results in corrupted indexes
On 14.12.2013, at 17.19, martijn.list <martijn.list at gmail.com> wrote:> I'm experimenting with the mail-filter plugin but whenever I add > anything to a message, it always results in an corrupted cache:You can't currently change the message with mail-filter plugin. That would require some additional changes to it.
martijn.list
2013-Dec-14 16:49 UTC
[Dovecot] mail-filter always results in corrupted indexes
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(martijn=djigzo.com at ciphermail.private): Error: Corrupted index > cache file > /var/vmail/martijn=djigzo.com at ciphermail.private/dovecot.index.cache: > Broken physical size for mail UID 76 > Dec 14 16:09:55 ciphermail-webmail dovecot: > imap(martijn=djigzo.com at ciphermail.private): Error: read() failed: > Invalid argument > Dec 14 16:10:02 ciphermail-webmail dovecot: > imap(martijn=djigzo.com at ciphermail.private): Error: Cached message size > smaller than expected (773 < 777) > Dec 14 16:10:02 ciphermail-webmail dovecot: > imap(martijn=djigzo.com at ciphermail.private): Error: Maildir filename has > wrong S value, renamed the file from > /var/vmail/martijn=djigzo.com at ciphermail.private/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