Emacs gnus (tls) IMAP connection problems with Google

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Emacs gnus (tls) IMAP connection problems with Google

Kostas Zorbadelos-2

Hello all,

I use emacs gnus for all my mail handling mostly over IMAP.
A recent upgrade in my Arch system left me with a very strange
problem. My software versions:

GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-07-05

gnutls 3.6.5-4

My .gnus.el hasn't changed for a very long time, looking like this:

(add-to-list 'gnus-secondary-select-methods '(nnimap "gmail"
                                  (nnimap-address "imap.gmail.com")
                                  (nnimap-server-port 993)
                                  (nnimap-stream ssl)
                                  (nnimap-authinfo-file "~/.authinfo.gpg")))

Everything worked very well until I got the following errors connecting
to Google's IMAP service (could be that a recent gnutls upgrade is
responsible, older versions of emacs and gnutls I use in other Linux
systems have no such issue)  

*Messages*
Opening nnimap server on gmail...
Opening connection to imap.gmail.com via tls...
Unable to open server nnimap+gmail due to: Process *nnimap*<1> not running
Opening nnimap server on gmail...failed:

Sometimes however (rarely) the connections are established OK.

Unfortunately, I could not debug this, I am at a loss. Trying to get
more info, I found a workaround by setting

(setq gnutls-log-level 2)

in .gnus.el. So, when gnutls debugging is turned on, seems the problem
is hiding (timing issue?). Since mail handling is a core activity for me
I would highly appreciate any help in debugging and solving the
issue. Let me know if and how I can provide any logs / further info. I
run a current version of Arch Linux (updated today).
If you think this list is not appropriate for the issue, feel free to
suggest a more proper place for the discussion.

Regards,
Kostas Zorbadelos

Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Alex Kost
Kostas Zorbadelos (2019-01-26 13:13 +0200) wrote:

> Hello all,

Hello,

> I use emacs gnus for all my mail handling mostly over IMAP.
> A recent upgrade in my Arch system left me with a very strange
> problem. My software versions:
>
> GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
>  of 2018-07-05
>
> gnutls 3.6.5-4
>
> My .gnus.el hasn't changed for a very long time, looking like this:
>
> (add-to-list 'gnus-secondary-select-methods '(nnimap "gmail"
>                                   (nnimap-address "imap.gmail.com")
>                                   (nnimap-server-port 993)
>                                   (nnimap-stream ssl)
>  (nnimap-authinfo-file "~/.authinfo.gpg")))
>
> Everything worked very well until I got the following errors connecting
> to Google's IMAP service (could be that a recent gnutls upgrade is
> responsible, older versions of emacs and gnutls I use in other Linux
> systems have no such issue)
>
> *Messages*
> Opening nnimap server on gmail...
> Opening connection to imap.gmail.com via tls...
> Unable to open server nnimap+gmail due to: Process *nnimap*<1> not running
> Opening nnimap server on gmail...failed:
>
> Sometimes however (rarely) the connections are established OK.

I think I have a similar problem: whenever I try to enter my gmail group
for the first time, I get the following error:

  gnus-select-newsgroup: Couldn’t request group nnimap+gmail:INBOX:

But if I enter it again immediately, it opens successfully.

Sorry, I don't have more information, it is just a "me too" message :-)

--
Alex

Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Van L
In reply to this post by Kostas Zorbadelos-2
> But if I enter it again immediately, it opens successfully.

It's possible the first attempt fell in a black hole on the 'net.
The second attempt went a different circuitous route.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Kostas Zorbadelos-2
On Κυρ, Ιαν 27 2019 at 01:55:03 μμ, Van L <[hidden email]> wrote:

>> But if I enter it again immediately, it opens successfully.
>
> It's possible the first attempt fell in a black hole on the 'net.
> The second attempt went a different circuitous route.
>

In my case, the problem is consistent. Hopefully someone could give a
clue on how to debug the issue and get more information.

--
Kostas Zorbadelos

Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Van L
In reply to this post by Kostas Zorbadelos-2
>> It's possible the first attempt fell in a black hole on the 'net.
>> The second attempt went a different circuitous route.

> In my case, the problem is consistent.
> Hopefully someone could give a clue on how to debug the issue and get more information.

The Taipei Times reported yesterday that the link between Fiji and Tonga has been cut the last five days. Tonga is isolated in the main other than satlinks for priority traffic, which does not include Facebook for holiday makers. Traffic won’t get through there, for example.

One way to sussout what’s going for you is to see the raw packet exchange and interpret that with capture tools. (Wireshark? Kali?)
Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Grant Rettke-3
In reply to this post by Kostas Zorbadelos-2
On Sun, Jan 27, 2019 at 11:39 AM Kostas Zorbadelos <[hidden email]> wrote:
> In my case, the problem is consistent. Hopefully someone could give a

A few weeks ago I ran into a problem with TLS. The context was using
Org2Block. Org2Blog
runs in Emacs and talks to WordPress via XML-RPC over TLS.

Short story of my solution is that I had to configure GnuTLS to
not-use TLSv1.3. Here is the explanation:
https://github.com/org2blog/org2blog/wiki/Debugging-Stories#inexplicably-cant-login-or-do-anything
.

Here is the config, which you can only set up once, and now every tls
connection Emacs makes will use this config:

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

The long version is how I figured it out:

https://github.com/org2blog/org2blog/wiki/Debugging#when-things-go-wrong-how-to-debug

Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Emanuel Berg-5
Grant Rettke wrote:

> A few weeks ago I ran into a problem with
> TLS. The context was using Org2Block.
> Org2Blog runs in Emacs and talks to WordPress
> via XML-RPC over TLS.

I don't know if it is related, but I get this
error

    gnutls.c: [0] (Emacs) fatal error: Error in the pull function.

very often with Gnus and TLS.

I then do C-g and try to get mail/news again,
and then it most often works. It seems to be
the previous connection that has somehow, for
some reason, failed. (Sometimes I do not get
the message, Emacs just stalls forever, and
this is also remedied with C-g.)

I reported it as a Gnus bug but apparently it
isn't in Gnus but somewhere else, which perhaps
the error message itself is indicative of.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Kostas Zorbadelos-2
In reply to this post by Grant Rettke-3

Thank you so much about this, works for me too. To be honest I got lazy
since I found the workaround and didn't trace using wireshark. One
question now is whether this is an issue with Google's IMAP tls 1.3
implementation or it's a gnutls issue.

Best regards,
Kostas

On Sun, Feb 10 2019 at 03:54:49 PM, Grant Rettke <[hidden email]> wrote:

> On Sun, Jan 27, 2019 at 11:39 AM Kostas Zorbadelos <[hidden email]> wrote:
>> In my case, the problem is consistent. Hopefully someone could give a
>
> A few weeks ago I ran into a problem with TLS. The context was using
> Org2Block. Org2Blog
> runs in Emacs and talks to WordPress via XML-RPC over TLS.
>
> Short story of my solution is that I had to configure GnuTLS to
> not-use TLSv1.3. Here is the explanation:
> https://github.com/org2blog/org2blog/wiki/Debugging-Stories#inexplicably-cant-login-or-do-anything
> .
>
> Here is the config, which you can only set up once, and now every tls
> connection Emacs makes will use this config:
>
> (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
>
> The long version is how I figured it out:
>
> https://github.com/org2blog/org2blog/wiki/Debugging#when-things-go-wrong-how-to-debug

--
Kostas Zorbadelos

Reply | Threaded
Open this post in threaded view
|

Re: Emacs gnus (tls) IMAP connection problems with Google

Robert Pluim
Kostas Zorbadelos <[hidden email]> writes:

> Thank you so much about this, works for me too. To be honest I got lazy
> since I found the workaround and didn't trace using wireshark. One
> question now is whether this is an issue with Google's IMAP tls 1.3
> implementation or it's a gnutls issue.

I think Google's TLS 1.3 implementation is fine. The way emacs 26.1
uses the GnuTLS api is slightly wrong for tls1.3. It looks like Paul
Eggert has already fixed this for the unreleased emacs-27.1, maybe
that fix can be applied to emacs-26 as well.

Robert