Johannes Berg
2004-Dec-27 07:08 UTC
[Dovecot] possible bug with mail->get_header and caching?
I don't know if this is intended or not, but here it comes.
I have
* that copy plugin I was working on
* dovecot 1.0-test59
* thunderbird test client
My copy plugin looks for the X-DSPAM-Signature header line, and reports
it to syslog as such:
imap: we have a signature: "X-DSPAM-Signature: <sig>"
where <sig> is replaced by what is found in the header line. This only
happens when I copy in/out of the SPAM folder (which works fine).
Now, when a mail is copied from INBOX to SPAM that doesn't have the
signature line, I return an error to the client saying the user can't do
that copy since the signature line is necessary. I detect the condition
of not having that signature line by checking like this:
if (!(signature = mail->get_header(mail, "X-DSPAM-Signature")) {
... return error ...
}
This works fine, error comes back.
Second try, copying a mail that has the header line: works.
So, lets do some code changes, disconnect and reconnect to reload the
plugin. All of a sudden, copying mails that don't have the header line
works too! Uhh? Lets go looking at syslog:
imap: we have a signature: "X-DSPAM-Signature: "
The only rational explanation I could come up with is that dovecot
caches the header line and somehow decided that since it knows about the
X-DSPAM-Signature header line mails that don't contain it should have an
empty version of it. Well, I can of course test for this (and I actually
should anyway, an empty signature isn't useful to dspam), but I do think
this is a bug since it makes distinguishing between empty and
non-present header lines impossible.
Regards,
johannes
Johannes Berg
2004-Dec-28 10:41 UTC
[Dovecot] possible bug with mail->get_header and caching?
Johannes Berg schrieb:> I don't know if this is intended or not, but here it comes. > [...]This seems to be only a symptom of a larger problem, I put my plugin and test59 into "production" on my private server, and once a while my plugin complains that it couldn't find the x-dspam-signature header line even though it is present, usually it helps to simply re-try that message. johannes
Timo Sirainen
2005-Jan-06 21:13 UTC
[Dovecot] possible bug with mail->get_header and caching?
I fixed several problems with this in CVS. They probably also caused the SORT/THREAD problems mentioned some months ago in this list.. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20050106/5a00a164/attachment-0001.bin>