Wrong detection of new mails

From: Pavel Sanda <ps_at_twin.jikos.cz>
Date: Fri, 27 Jul 2007 12:13:59 +0200


i recently updated to newmail 0.4. and it has unfortunately
one bug, which the very old version i used before had not.

the problem is that newmail signals new mail even in case
that i only reply to some other mail and also in other cases
when changing flags of the mails.

i found the reason of the bug (which is the same as two years-back report on list):
newmail detects changes on mailbox only by means of filesize.
if it detects change, it seeks to the last scanned position in the file
and scans from this position to newly arrived messages.

the problem happens in the moment, when email reader makes some
change on mailbox which in fact makes the files bigger - as flagging
some messages as replied etc. newmail detects bigger file, seeks
into some weird position inside (usually) last message, scans its
body, dont find header info and emit " - " message to console.

it will be little difficult to write some 100% correct and short patch
simultaneously for this :)

attached oneliner patch just test emptiness of emitted message,
   which wont be written to console in such a case.
   drawbacks are clear:
   a) we dont get info about messages which dont have name and subject in header
   b) if there are much more messages somewhat flagged by mail client, newmail
      will seek before message(s) at the end and detect wrongly old message(s) as new.

another possibility would be to analyse time flags of mailbox (access,modify,change),
which works for me on combination of mutt+procmail but its really question
whether other combinations would be so fortunate.

yet another possibility would be to parse mailbox in more intricated way
or remember last message etc.

any other ideas ?

i tried to look on old versions of newmail, which i used and which didnt have this
bug and to my surpise its seems to be quite different code. heh :)

nice day

Received on Fri Jul 27 2007 - 12:13:59 CEST

This archive was generated by hypermail 2.2.0 : Fri Jul 27 2007 - 12:14:29 CEST