[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 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
Johannes Berg wrote:
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.
Timo, could you look into this please? This seems to be the case usually when I move multiple messages at once.
johannes
On Wed, 2004-12-29 at 23:28 +0100, Johannes Berg wrote:
Johannes Berg wrote:
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.
Timo, could you look into this please? This seems to be the case usually when I move multiple messages at once.
I'll try to look it next week. I have a deadline for another project next monday and suddendly I realized there's also new year coming next weekend. Busy. :)
The "not existing" vs "empty" problem exists because of cache file and it needs fixing, but I don't know about the problem you describe above.. If you could figure out what commmands would reproduce it I could fix it faster.
Timo Sirainen schrieb:
The "not existing" vs "empty" problem exists because of cache file and
it needs fixing, but I don't know about the problem you describe above.. If you could figure out what commmands would reproduce it I could fix it faster.
I can't reproduce it, consider it a bug in my code until I can ;) (and I've just rewritten parts of my code, so...)
johannes
I fixed several problems with this in CVS. They probably also caused the SORT/THREAD problems mentioned some months ago in this list..
participants (2)
-
Johannes Berg
-
Timo Sirainen