GNU bug report logs - #30022
gnus nnimap-sequence vs yahoo hang

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs,gnus; Reported by: Kevin Ryde <user42_kevin@HIDDEN>; Keywords: moreinfo; dated Mon, 8 Jan 2018 06:03:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 30022 <at> debbugs.gnu.org:


Received: (at 30022) by debbugs.gnu.org; 11 Apr 2018 21:01:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 11 17:01:33 2018
Received: from localhost ([127.0.0.1]:46581 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f6Ms1-0008Uh-3y
	for submit <at> debbugs.gnu.org; Wed, 11 Apr 2018 17:01:33 -0400
Received: from hermes.netfonds.no ([80.91.224.195]:43039)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1f6Mrz-0008SM-42
 for 30022 <at> debbugs.gnu.org; Wed, 11 Apr 2018 17:01:31 -0400
Received: from 46.67.12.60.tmi.telenormobil.no ([46.67.12.60] helo=corrigan)
 by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <larsi@HIDDEN>)
 id 1f6Mrw-0001y5-73; Wed, 11 Apr 2018 23:01:30 +0200
Received: from larsi by corrigan with local (Exim 4.89)
 (envelope-from <larsi@HIDDEN>)
 id 1f6Mrq-0002OT-4A; Wed, 11 Apr 2018 23:01:22 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Kevin Ryde <user42_kevin@HIDDEN>
Subject: Re: bug#30022: gnus nnimap-sequence vs yahoo hang
References: <87wp0svqgr.fsf@HIDDEN>
Date: Wed, 11 Apr 2018 23:01:21 +0200
In-Reply-To: <87wp0svqgr.fsf@HIDDEN> (Kevin Ryde's message of "Mon, 08 Jan
 2018 17:01:40 +1100")
Message-ID: <87efjlzcda.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30022
Cc: 30022 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Kevin Ryde <user42_kevin@HIDDEN> writes:

> With the gnus included in recent debian packaged i386 emacs 25.2, in the
> Group buffer, an M-g to get count of messages of a foreign imap group at
> imap.mail.yahoo.com hangs.  If C-g to stop then a second M-g succeeds.
>
> Sticking in some protocol trace showed
>
>     out >> 1 CAPABILITY
>     out >> 1 LOGIN "username" "password"

Hm, that looks wrong.  nnimap should be increasing the sequence
number...

When I switch nnimap tracing on (by setting `nnimap-record-commands' to
t and looking in the " *imap log*" (note leading space) buffer, then I
get

1 LOGIN
2 CAPABILITY

which is what I'd expect.

Could you include the data from the logging buffer?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#30022; Package emacs,gnus. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Jan 2018 06:02:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 08 01:02:40 2018
Received: from localhost ([127.0.0.1]:40129 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYQW7-0002QB-Un
	for submit <at> debbugs.gnu.org; Mon, 08 Jan 2018 01:02:40 -0500
Received: from sonic309-22.consmr.mail.gq1.yahoo.com ([98.137.65.148]:37841)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1eYQW6-0002Px-8u
 for submit <at> debbugs.gnu.org; Mon, 08 Jan 2018 01:02:38 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1515391352; bh=XottaD7LEuYsgSLrl8LGOXCkgX2eQ6d/ARKK/iB/Uf8=;
 h=From:To:Subject:Date:From:Subject;
 b=PPthghVycu5FlMFT9Gnw0fvwPokdwGtMaaqUgcsXLhaTVc2lzc/I9Ucu8/vfiuYuFxIwX0xsrjR6j/CKT5WPaiyFz31T0JTydpwRSOaHmBkhQXsnYAEWVEHRVBIYB+ySbjxuo7T7/usjb6mkLrlVWb5WKY5/+7HehtvZTxDdoJzSQ1s1HRxYa5xLQWvBB+AdteDq40Dv5wTFeSwX6uGIghKhDVEXWUrnUJvKhwpwveTaNdPFu4qd0rP7CBFm6BUn5ZzVoIsaHfBXa20sbP2Rq+7FxhNQPXZ5djbPLyjCF4LKsJnKTReNWL6dPqR7i5DqSBh8bk6LWOOH1SENbny7zw==
X-YMail-OSG: LvUal88VM1mnEEJCWHqdEkKAo0WQa47FXzRwi2q_.NQ_yrxQtAY_O1HRwu_f5uh
 NLirzEItYZzR7hHV9INVK3vAzPTK3z.mmLvf4NuWS8UFS05LftC2KhymC7yznNY3Zfz8v9_YQScv
 wfQWlggrCUcGPZHvR_c1MxP60cgq2AvT_QRKKLFiS4otXf39N6IENNChW8tEJNpvM4SRPKz4zwLa
 DnC0qFnE1x3mR3ZmXsiNEuC0fr7zLnqasRhKqjNji13nQqU6E2UHAk1E9cf_KEWVjO_MPd7VNjHb
 RagYmopMB3RfyGpjSM.yVvTqalzUXWC1UWgzfQeJzqEqsWMVZZe0F0XPZBI8w7Z5pOAJS6Tq.XKU
 dUZN2B9nEKcuJ27U2f5yMnhytHZkKilBzkzD.DG2neAZqKgUYEOq1.g_kB9nEVWgFiAJuLQwbXQo
 c.FzYPedF9eMefJ75BXMDfPeHy30FvSW.MIiReK0l749Frp6SHM0G.keTBL6cBvCRnAmoV.2GPLO
 Mx0qHTlU92Q--
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic309.consmr.mail.gq1.yahoo.com with HTTP; Mon, 8 Jan 2018 06:02:32 +0000
Received: from smtp102.rhel.mail.gq1.yahoo.com (EHLO blah.blah)
 ([216.39.57.211])
 by smtp416.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID
 9a3eaf7bc8172f8ab56b057cea3c52be for <submit <at> debbugs.gnu.org>;
 Mon, 08 Jan 2018 06:02:31 +0000 (UTC)
From: Kevin Ryde <user42_kevin@HIDDEN>
To: submit <at> debbugs.gnu.org
Subject: gnus nnimap-sequence vs yahoo hang
X-Debbugs-Version: 5.13
X-Debbugs-Package: gnus
Date: Mon, 08 Jan 2018 17:01:40 +1100
Message-ID: <87wp0svqgr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

--=-=-=
Content-Type: text/plain

With the gnus included in recent debian packaged i386 emacs 25.2, in the
Group buffer, an M-g to get count of messages of a foreign imap group at
imap.mail.yahoo.com hangs.  If C-g to stop then a second M-g succeeds.

Sticking in some protocol trace showed

    out >> 1 CAPABILITY
    out >> 1 LOGIN "username" "password"

    in  << 1 OK CAPABILITY completed
    out >> 2 SELECT "mailboxname"
    
    in  << 1 OK LOGIN completed
    hang ...

I suspect nnimap.el interprets "1 OK CAPABILITY" response as being login
completion, and issues the SELECT.  Could that be right?

I don't know if a server is supposed to allow pipelined SELECT before
login completes.  It seems recent imap.mail.yahoo.com doesn't like it.
I see nnimap-login uses nnimap-command so I take it the intention in
gnus is not to attempt such a thing anyway, but wait for login success.

I get some joy from the diff below setting nnimap-sequence so it starts
"2 LOGIN".  The first M-g then succeeds for me as hoped.

I think the reason a second M-g on the group succeeds is that
nnimap-sequence is left incremented after the first attempt, so it goes
"3 LOGIN" or whatever bigger number.

I have this on a rather lagged connection, if that might make a
difference.  I see the login taking a noticeable second or so, but don't
know if that's by the server or the connection.

-------------------
Gnus v5.13
GNU Emacs 25.2.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2017-09-12, modified by Debian


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-nnimap-sequence-initial-value-1-so-first-command-is-.patch

From 6acf5ee48665e2b0addc66bb329fc21df27ddd3b Mon Sep 17 00:00:00 2001
From: Kevin Ryde <user42_kevin@HIDDEN>
Date: Mon, 8 Jan 2018 12:29:07 +1100
Subject: [PATCH] nnimap-sequence initial value 1 so first command is "2 LOGIN"
 which is different tag than "1 CAPABILITY" in open-network-stream.

Previous initial value 0 giving "1 LOGIN" was reckoned completed by
the 1 CAPABILITY response, causing SELECT to be sent pipelined, which
imap.mail.yahoo.com circa 2017 did not like (ignores, apparently,
causing gnus hang, with a gnus foreign imap group at least).
---
 lisp/gnus/nnimap.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 05251ed..eeaa10d 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1855,7 +1855,9 @@ nnimap-find-connection
 	(setq nnimap-connection-alist (delq entry nnimap-connection-alist))
 	nil))))
 
-(defvar nnimap-sequence 0)
+;; nnimap-sequence is pre-incremented so first tag is "2" which is after
+;; "1 CAPABILITY" of :capability-command
+(defvar nnimap-sequence 1)
 
 (defun nnimap-send-command (&rest args)
   (setf (nnimap-last-command-time nnimap-object) (current-time))
-- 
2.15.1


--=-=-=--




Acknowledgement sent to Kevin Ryde <user42_kevin@HIDDEN>:
New bug report received and forwarded. Copy sent to bugs@HIDDEN. Full text available.
Report forwarded to bugs@HIDDEN:
bug#30022; Package gnus. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 11 Apr 2018 21:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.