Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* using local dovecot nnimap, gnus Group shows wrong counts and mail
@ 2012-06-23  1:39 myles
  2012-06-26 10:04 ` Jonas Hörsch
  0 siblings, 1 reply; 4+ messages in thread
From: myles @ 2012-06-23  1:39 UTC (permalink / raw)
  To: info-gnus-english

Hi,

I have been using emacs23 and gnus with a local dovecot server but there are
problems with emacs24.1, both with the built-in and git gnus.

On the dovecot server I have gmailOne, anotherGmail, and one another.  I am
trying to use gmailOne and anotherGmail from gnus using this set up:

(setq debug-on-error t)
;; we are only using email
(setq gnus-nntp-server nil
      gnus-read-active-file nil
      gnus-save-newsrc-file nil
      gnus-read-newsrc-file nil
      gnus-check-new-newsgroups nil)

(setq nnimap-record-commands t)

(setq gnus-select-method '(nntp "news.gnus.org"))

(setq gnus-secondary-select-methods
      '((nnimap "gmailOne"
		(nnimap-address "localhost")
		(nnimap-user gmailOne)
		(nnimap-stream network)
;;		(nnimap-authinfo-file "/home/myles/.authinfoGMAILONE")
		;;(nnimap-authenticator login)
		(nnimap-shell-program "MAIL=maildir:/home/myles/Maildir/gmailOne /usr/lib/dovecot/imap"))
	(nnimap "anotherGmail"
		(nnimap-address "localhost")
		(nnimap-user anotherGmail)
		(nnimap-stream network)
;;		(nnimap-authinfo-file "/home/myles/.authinfoANOTHERGMAIL")
		;;(nnimap-authenticator login)
		(nnimap-shell-program "MAIL=maildir:/home/myles/Maildir/anotherGmail /usr/lib/dovecot/imap"))))

The problem is that when a group is selected in *Group* buffer, the INBOX
changes to be that of one of the other dovecot accounts

The steps I do are:

$ rm ~/.newsr* ~/.authinfo
- start emacs
- M-x gnus
- prompts for "IMAP password for gmailOne@localhost:"
- I enter the password
- the dovecot log shows that it connects ok including mail=maildir:/home/myles/Maildir/gmailOne
- prompts for "IMAP password for anotherGmail@localhost:"
- I enter the password
- the dovecot log shows that it connects ok including mail=maildir:/home/myles/Maildir/anotherGmail
- in the *Group* buffer
- press g
- Shows:       1: nndraft:drafts   (which is correct)
- press A A
- scrolldown to "   *: nnimap+gmailOne:INBOX " and press u
- shows     3437: nnimap+gmailOne:INBOX (which is correct)
- scrolldown to "   *: nnimap+anotherGmail:INBOX " and press u
- shows     12: nnimap+anotherGmail:INBOX             (which is correct)
- press g
- shows:
       1: nndraft:drafts
    3857: nnimap+gmailOne:INBOX
    3416: nnimap+anotherGmail:INBOX

Which is wrong number of messages.

Going up to *Gnus Browse Server* (pressing ^) and then into the servers
individually, initially shows the correct number of messages, e.g. in
"{nnimap:anotherGmail} (opened) (agent)"

K      0: Drafts
      12: INBOX
K      0: Queue
K      0: Sent
K      0: Trash

But then pressing RTN on the INBOX gives the prompt:

How many articles from INBOX (3416 default), which is wrong again.

Looking in these groups with the wrong article counts show messages that
should be in other groups (i.e. in the other gmail [and non gmail] accounts).

The buffer *imap log* shows this (where the mailbox with the orgmode mailing list folder
is the gmailOne acc.):

02:02:08 [localhost] (inhibited)
02:02:08 [localhost] 2 ENABLE QRESYNC
02:02:08 [localhost] 3 LIST "" "*"
02:02:08 [localhost] 4 EXAMINE "Trash"
02:02:08 [localhost] 5 EXAMINE "dolfin"
02:02:08 [localhost] 6 EXAMINE "Sent"
02:02:08 [localhost] 7 EXAMINE "Queue"
02:02:08 [localhost] 8 EXAMINE "aur-general"
02:02:08 [localhost] 9 EXAMINE "Drafts"
02:02:08 [localhost] 10 EXAMINE "orgmode"
02:02:08 [localhost] 11 EXAMINE "INBOX"
02:02:11 [localhost] (inhibited)
02:02:11 [localhost] 13 ENABLE QRESYNC
02:02:11 [localhost] 14 LIST "" "*"
02:02:11 [localhost] 15 EXAMINE "Trash"
02:02:11 [localhost] 16 EXAMINE "Sent"
02:02:11 [localhost] 17 EXAMINE "Queue"
02:02:11 [localhost] 18 EXAMINE "Drafts"
02:02:11 [localhost] 19 EXAMINE "INBOX"
02:03:15 [localhost] 20 LIST "" "*"
02:03:15 [localhost] 21 EXAMINE "Trash"
02:03:15 [localhost] 22 EXAMINE "dolfin"
02:03:15 [localhost] 23 EXAMINE "Sent"
02:03:15 [localhost] 24 EXAMINE "Queue"
02:03:15 [localhost] 25 EXAMINE "aur-general"
02:03:15 [localhost] 26 EXAMINE "Drafts"
02:03:15 [localhost] 27 EXAMINE "orgmode"
02:03:15 [localhost] 28 EXAMINE "INBOX"
02:03:15 [localhost] 29 LIST "" "*"
02:03:15 [localhost] 30 EXAMINE "Trash"
02:03:15 [localhost] 31 EXAMINE "Sent"
02:03:15 [localhost] 32 EXAMINE "Queue"
02:03:15 [localhost] 33 EXAMINE "Drafts"
02:03:15 [localhost] 34 EXAMINE "INBOX"
02:05:55 [localhost] 35 SELECT "INBOX"
02:05:55 [localhost] 36 UID FETCH 1:* FLAGS
02:05:55 [localhost] 37 SELECT "INBOX"
02:05:55 [localhost] 38 UID FETCH 1:* FLAGS
02:16:52 [localhost] 39 NOOP
02:16:52 [localhost] 40 NOOP
02:30:35 [localhost] 41 LIST "" "*"
02:30:35 [localhost] 42 EXAMINE "Trash"
02:30:35 [localhost] 43 EXAMINE "Sent"
02:30:35 [localhost] 44 EXAMINE "Queue"
02:30:35 [localhost] 45 EXAMINE "Drafts"
02:30:35 [localhost] 46 EXAMINE "INBOX"
02:30:45 [localhost] 47 SELECT "INBOX"
02:31:52 [localhost] 48 NOOP

How can I get gnus to behave as expected, with the correct mailbox contents?  Connecting to dovecot works fine with claws-mail but gnus is embedded in my daily work and I can't do without it.

Thanks,
Myles

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

* Re: using local dovecot nnimap, gnus Group shows wrong counts and mail
  2012-06-23  1:39 using local dovecot nnimap, gnus Group shows wrong counts and mail myles
@ 2012-06-26 10:04 ` Jonas Hörsch
  2012-06-26 10:10   ` Jonas Hörsch
  2012-07-08  1:36   ` Myles
  0 siblings, 2 replies; 4+ messages in thread
From: Jonas Hörsch @ 2012-06-26 10:04 UTC (permalink / raw)
  To: info-gnus-english

On Sat, Jun 23 2012, myles wrote:

> (setq gnus-secondary-select-methods
>       '((nnimap "gmailOne"
> 		(nnimap-address "localhost")
> 		(nnimap-user gmailOne)
> 		(nnimap-stream network)
> ;;		(nnimap-authinfo-file "/home/myles/.authinfoGMAILONE")
> 		;;(nnimap-authenticator login)
> 		(nnimap-shell-program "MAIL=maildir:/home/myles/Maildir/gmailOne /usr/lib/dovecot/imap"))

i guess, in your setup the nnimap-shell-program specification is not
used at all, because you're telling gnus to connect via the network to
the listening dovecot server instead of starting it by shell.

(if it was connecting by shell/pipe, you would not be asked for
authentication, as you're starting it by yourself)

to do what you meant to do, you might try to use:

(setq gnus-secondary-select-methods
      '((nnimap "gmailOne"
		(nnimap-stream shell)
		(nnimap-shell-program
               "MAIL=maildir:/home/myles/Maildir/gmailOne
               /usr/lib/dovecot/imap"))))

the only remaining problem is, that dovecot 2.x doesn't pay respect to
the MAIL environment variable anymore, but rather just uses the setting
mail_location in its configuration (at least in my install), which you
can test f.ex. by python

the only remaining problem is, that dovecot 2.x doesn't pay respect to
the MAIL environment variable anymore, but rather just uses the setting
mail_location in its configuration (at least in my install), which you
can test f.ex. by python

import imaplib
print("\n".join(imaplib.IMAP4_stream("MAIL=maildir:/home/myles/Maildir/gmailOne /usr/lib/dovecot/imap").list()[1]))

will list the directories which imap shows.

perhaps there is another environment variable which does what you want,
i don't know.

alternatively you could just use one global maildir and have you're
different accounts as subdirectories. judging by [1], this might be
possible by just renaming them to .gmailOne and .gmailTwo .

well, good luck,
jonas

Footnotes:

[1] http://wiki2.dovecot.org/MailLocation

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

* Re: using local dovecot nnimap, gnus Group shows wrong counts and mail
  2012-06-26 10:04 ` Jonas Hörsch
@ 2012-06-26 10:10   ` Jonas Hörsch
  2012-07-08  1:36   ` Myles
  1 sibling, 0 replies; 4+ messages in thread
From: Jonas Hörsch @ 2012-06-26 10:10 UTC (permalink / raw)
  To: info-gnus-english

On Tue, Jun 26 2012, Jonas Hörsch wrote:

> alternatively you could just use one global maildir and have you're
> different accounts as subdirectories. judging by [1], this might be
> possible by just renaming them to .gmailOne and .gmailTwo .
>
> [1] http://wiki2.dovecot.org/MailLocation

ups, got confused with my open websites. i was referring to "Directory
Structure" on

http://wiki2.dovecot.org/MailboxFormat/Maildir


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: using local dovecot nnimap, gnus Group shows wrong counts and mail
  2012-06-26 10:04 ` Jonas Hörsch
  2012-06-26 10:10   ` Jonas Hörsch
@ 2012-07-08  1:36   ` Myles
  1 sibling, 0 replies; 4+ messages in thread
From: Myles @ 2012-07-08  1:36 UTC (permalink / raw)
  To: info-gnus-english

Jonas Hörsch <coroa <at> online.de> writes:

> i guess, in your setup the nnimap-shell-program specification is not
> used at all, because you're telling gnus to connect via the network to
> the listening dovecot server instead of starting it by shell.
> 
> (if it was connecting by shell/pipe, you would not be asked for
> authentication, as you're starting it by yourself)
> 
> to do what you meant to do, you might try to use:
> 
> (setq gnus-secondary-select-methods
>       '((nnimap "gmailOne"
> 		(nnimap-stream shell)
> 		(nnimap-shell-program
>                "MAIL=maildir:/home/myles/Maildir/gmailOne
>                /usr/lib/dovecot/imap"))))

Jonas,

Thanks a lot for your help.  Your answer prompted me to try again (once I
got back from holiday) and I realise that I was slightly confused; the
MAIL variable is not needed because userdb_mail is set when
/etc/dovecot/passwd is queried during authentication, e.g.

gmailOne:{plain}GMAILONEPASSWD:1000:1000::/home/myles::userdb_mail=maildir:
/home/myles/Maildir/gmailOne

However, I think there is still a problem: where two virtual servers resolve
to the same host, gnus confuses the two mail boxes, may be it connects
correctly to the IMAP server to start with but subsequently just looks up
the connection by the ip address.

So, I now connect via network (to force the use of authentication) :

(setq gnus-secondary-select-methods
      '((nnimap "gmailOne"
		(nnimap-address "localhost")
		(nnimap-user gmailOne)
		(nnimap-stream network)
)
	(nnimap "gmailTwo"
		(nnimap-address "localhost")
		(nnimap-user gmailTwo)
		(nnimap-stream network)
)))

It correctly reads credentials from .authinfo and authenticates with dovecot,
I can subscribe to groups but when refreshing the *Groups* buffer, again,
the message counts are wrong and the messages from one account appear in the
other one.  Claws-mail manages okay.

> alternatively you could just use one global maildir and have you're
> different accounts as subdirectories. judging by [1], this might be
> possible by just renaming them to .gmailOne and .gmailTwo .

Trying that would be a last resort because I would have to download all my gmail
again, but I will keep it in mind.

I tried using localhost2 for the second server and adding to /etc/hosts but get
the same behaviour.

Any more ideas?

Myles



_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

end of thread, other threads:[~2012-07-08  1:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-23  1:39 using local dovecot nnimap, gnus Group shows wrong counts and mail myles
2012-06-26 10:04 ` Jonas Hörsch
2012-06-26 10:10   ` Jonas Hörsch
2012-07-08  1:36   ` Myles

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).