Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap not reporting correct number of unseen articles
@ 2006-06-20 13:37 joakim
  2006-06-20 15:55 ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: joakim @ 2006-06-20 13:37 UTC (permalink / raw)


I do M-g on a group and see 6 new messages in the group. I enter the
greoup and there is only 1 new message really. Why is this?


-- 
Joakim Verona
http://www.verona.se




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap not reporting correct number of unseen articles
  2006-06-20 13:37 nnimap not reporting correct number of unseen articles joakim
@ 2006-06-20 15:55 ` Simon Josefsson
  2006-06-20 17:33   ` joakim
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2006-06-20 15:55 UTC (permalink / raw)
  Cc: ding

joakim@verona.se writes:

> I do M-g on a group and see 6 new messages in the group. I enter the
> greoup and there is only 1 new message really. Why is this?

The unread message count is only an estimate.  It works if the message
UIDs are assigned continuously, and no article has been removed, but
there are no guarantees that this holds.  It just happen to hold for
some common IMAP servers.

I think we had some code to make the guess better, but apparently it
can still fail.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap not reporting correct number of unseen articles
  2006-06-20 15:55 ` Simon Josefsson
@ 2006-06-20 17:33   ` joakim
  2006-06-21  7:52     ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: joakim @ 2006-06-20 17:33 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> joakim@verona.se writes:
>
>> I do M-g on a group and see 6 new messages in the group. I enter the
>> greoup and there is only 1 new message really. Why is this?
>
> The unread message count is only an estimate.  It works if the message
> UIDs are assigned continuously, and no article has been removed, but
> there are no guarantees that this holds.  It just happen to hold for
> some common IMAP servers.
>
> I think we had some code to make the guess better, but apparently it
> can still fail.

Do you have a pointer where I could look in the code, so that maybe I
could improve the guess for Dovecot?
-- 
Joakim Verona
http://www.verona.se



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap not reporting correct number of unseen articles
  2006-06-20 17:33   ` joakim
@ 2006-06-21  7:52     ` Simon Josefsson
  2006-06-21 12:06       ` gdt
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2006-06-21  7:52 UTC (permalink / raw)
  Cc: ding

joakim@verona.se writes:

> Simon Josefsson <jas@extundo.com> writes:
>
>> joakim@verona.se writes:
>>
>>> I do M-g on a group and see 6 new messages in the group. I enter the
>>> greoup and there is only 1 new message really. Why is this?
>>
>> The unread message count is only an estimate.  It works if the message
>> UIDs are assigned continuously, and no article has been removed, but
>> there are no guarantees that this holds.  It just happen to hold for
>> some common IMAP servers.
>>
>> I think we had some code to make the guess better, but apparently it
>> can still fail.
>
> Do you have a pointer where I could look in the code, so that maybe I
> could improve the guess for Dovecot?

The code that does the dirty work is
gnus-fixup-nnimap-unread-after-getting-new-news, nnimap-update-unseen
and nnimap-retrieve-groups.  You'll have to make sure g-f-n-u-a-g-n-n
knows the correct information somehow.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap not reporting correct number of unseen articles
  2006-06-21  7:52     ` Simon Josefsson
@ 2006-06-21 12:06       ` gdt
  2006-06-21 12:57         ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: gdt @ 2006-06-21 12:06 UTC (permalink / raw)
  Cc: ding

[-- Attachment #1: Type: text/plain, Size: 2658 bytes --]


Simon Josefsson <jas@extundo.com> writes:

> joakim@verona.se writes:
>
>> Simon Josefsson <jas@extundo.com> writes:
>>
>>> The unread message count is only an estimate.  It works if the message
>>> UIDs are assigned continuously, and no article has been removed, but
>>> there are no guarantees that this holds.  It just happen to hold for
>>> some common IMAP servers.
>>>
>>> I think we had some code to make the guess better, but apparently it
>>> can still fail.
>>
>> Do you have a pointer where I could look in the code, so that maybe I
>> could improve the guess for Dovecot?
>
> The code that does the dirty work is
> gnus-fixup-nnimap-unread-after-getting-new-news, nnimap-update-unseen
> and nnimap-retrieve-groups.  You'll have to make sure g-f-n-u-a-g-n-n
> knows the correct information somehow.

I have a similar issue, but I've learned not to worry.  This is all
with recent No Gnus, emacs 21.4.1 on NetBSD/i386 3.0_STABLE, and
dovecot 1.0beta7.

I use nnimap for my inbox, and follow the non-gnusy practice of
deleting articles that I'm done with, or refiling them (via 'B m') to
someplace else.  This keeps my inbox smallish (< 100 messages) and
only mail that I need to do something about, and also plays well with
using other IMAP clients on the same mailbox (thunderbird, Palm TX).
So it's quite normal for me to get a message, "delete" it the same way
tbird does:

(defun gdt-gnus-move-to-trash ()
  (interactive)
  (gnus-summary-move-article nil gdt-trash-newsgroup))
(local-set-key "d" 'gdt-gnus-move-to-trash)

and then exit the group.  When the next message arrives, it gets the
next uid, and gnus sees a uid two higher than the highest article (I
think) and I often see a count of 2 for one message.

This mostly happens for my inbox (for mailing list groups, I set
auto-expire and read them in a gnusy way), and for that all I really
care about is whether there are 0 messages or 1-or-more.

I've also noticed that if I read mail with another client (and sync
again to push the read marks back - the Palm is always in disconnected
mode) that gnus will report no unread articles.
So I think that the nnimap backend must be finding the uids of unread
articles.

I wonder if Joakim is having the same issue.

Perhaps gnus should maintain a highest-seen-ever uid for imap, but
this is probably awkward and doesn't really solve the problem.

Another approach which I think Simon suggested earlier is to add a
method to backends to return the # of unread articles.  imap does this
naturally, so I suspect it wouldn't be tht hard.

-- 
	Greg Troxel <gdt@work.lexort.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 185 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap not reporting correct number of unseen articles
  2006-06-21 12:06       ` gdt
@ 2006-06-21 12:57         ` Simon Josefsson
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Josefsson @ 2006-06-21 12:57 UTC (permalink / raw)
  Cc: joakim, ding

gdt@work.lexort.com writes:

> Perhaps gnus should maintain a highest-seen-ever uid for imap, but
> this is probably awkward and doesn't really solve the problem.

This is how Gnus does it right now, I think.  The problem is that

current-highest-seen-uid - stored-highest-seen-uid

does not equal the number of unread messages.

> Another approach which I think Simon suggested earlier is to add a
> method to backends to return the # of unread articles.  imap does this
> naturally, so I suspect it wouldn't be tht hard.

I thought gnus-fixup-nnimap-unread-after-getting-new-news was supposed
to do something similar, but I don't recall the details.

It is easy to get the # from IMAP, the difficult part is probably to
get Gnus to use the number correctly.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-21 12:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20 13:37 nnimap not reporting correct number of unseen articles joakim
2006-06-20 15:55 ` Simon Josefsson
2006-06-20 17:33   ` joakim
2006-06-21  7:52     ` Simon Josefsson
2006-06-21 12:06       ` gdt
2006-06-21 12:57         ` Simon Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).