[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@ciphermail.private): Error: Corrupted index cache file /var/vmail/martijn=djigzo.com@ciphermail.private/dovecot.index.cache: Broken physical size for mail UID 76 Dec 14 16:09:55 ciphermail-webmail dovecot: imap(martijn=djigzo.com@ciphermail.private): Error: read() failed: Invalid argument Dec 14 16:10:02 ciphermail-webmail dovecot: imap(martijn=djigzo.com@ciphermail.private): Error: Cached message size smaller than expected (773 < 777) Dec 14 16:10:02 ciphermail-webmail dovecot: imap(martijn=djigzo.com@ciphermail.private): Error: Maildir filename has wrong S value, renamed the file from /var/vmail/martijn=djigzo.com@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
On 14.12.2013, at 17.19, martijn.list martijn.list@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.
On 12/14/2013 04:21 PM, Timo Sirainen wrote:
On 14.12.2013, at 17.19, martijn.list martijn.list@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.
Would be nice if the email could be changed. Right now you need to be absolutely certain that the email is not changed in any way. even accidentally changing CR/LF to LF results in cache corruption.
To support modifying the email, does it require changes to the plugin or to Dovecot core?
Kind regards,
Martijn Brinkers
Hi
I am looking for help in processing the email at Dovecot Proxy (i.e replacing the links and attachments with custom links and attachments at IMAP proxy server). My understanding is that, mail_filter plugin should be hooked at Dovecot IMAP server. Can I integrate mail filter plugin (with some code changes) at Dovecot Proxy ?
If so, please suggest the changes required Dovecot core or mail filter plugin ?
-- View this message in context: http://dovecot.2317879.n4.nabble.com/mail-filter-always-results-in-corrupted... Sent from the Dovecot mailing list archive at Nabble.com.
Am 16.01.2014 08:13, schrieb cmreddy:
Hi
I am looking for help in processing the email at Dovecot Proxy (i.e replacing the links and attachments with custom links and attachments at IMAP proxy server). My understanding is that, mail_filter plugin should be hooked at Dovecot IMAP server. Can I integrate mail filter plugin (with some code changes) at Dovecot Proxy ?
If so, please suggest the changes required Dovecot core or mail filter plugin ?
As written before, this is simply not a good idea, it may generate heavy system overload and manipulate mail content may forbidden at many places filter your mail at smtp level, no need for doing it in imap proxy then
-- View this message in context: http://dovecot.2317879.n4.nabble.com/mail-filter-always-results-in-corrupted... Sent from the Dovecot mailing list archive at Nabble.com.
Best Regards MfG Robert Schetterer
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 15 Jan 2014, cmreddy wrote:
I am looking for help in processing the email at Dovecot Proxy (i.e replacing the links and attachments with custom links and attachments at IMAP proxy server). My understanding is that, mail_filter plugin should be hooked at Dovecot IMAP server. Can I integrate mail filter plugin (with some code changes) at Dovecot Proxy ?
If so, please suggest the changes required Dovecot core or mail filter plugin ?
I seem to remember an identical question a few weeks ago. Someone tried to write a plugin that alters the message. Timo answered that question with: NO, it is not possible with the current plugin code.
But try to find thread to get the correct info.
====
However, I find the idea "wrong". I mean, you want to alter the message each time when it is retrieved by the user. It seems to be a time slot, when any delay might cause lots of support calls. I would favour Robert's approach and alter the message when it comes in either through the MTA or before you pass it to the LDA with a wrapper script.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUtegynD1/YhP6VMHAQLRlAf+LzIXlgV4/Z5yNcbVcpSdIeFrlVhE1FUY t9PoteJY3/TtXUY5QVnqTi6csW72YnvsUq39Eu+D5YG5ofqCpeCPe18tC+ibzm7f WpIlP5HDYibTB2FgAwdTNbBq9DBnFDeEaPYOlundWvVJvCip4vN+3jaw0B85oeS2 fGJlol88WF7/kcIgS/PQvMFHRW93hvePOlsxPi2EwGNunyZ90ziasqOwCrBmujCj g09E2oiOONyoUuyb5UOIoS6u7ICKwvtSkmnj1Pck2sym1Xgvy+PNnWXM67mW1l7f Xs+Bppq+Xor7bfMrrYynXDXU3CtOWmQMmMFN8+fhS6qTHMS4ZfqQYw== =E7u9 -----END PGP SIGNATURE-----
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@ciphermail.private): Error: Corrupted index cache file /var/vmail/martijn=djigzo.com@ciphermail.private/dovecot.index.cache: Broken physical size for mail UID 76 Dec 14 16:09:55 ciphermail-webmail dovecot: imap(martijn=djigzo.com@ciphermail.private): Error: read() failed: Invalid argument Dec 14 16:10:02 ciphermail-webmail dovecot: imap(martijn=djigzo.com@ciphermail.private): Error: Cached message size smaller than expected (773 < 777) Dec 14 16:10:02 ciphermail-webmail dovecot: imap(martijn=djigzo.com@ciphermail.private): Error: Maildir filename has wrong S value, renamed the file from /var/vmail/martijn=djigzo.com@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
participants (5)
-
cmreddy
-
martijn.list
-
Robert Schetterer
-
Steffen Kaiser
-
Timo Sirainen