Re: Timing out while trying to connect to gmail. Config?

Mauricio Tavares <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <CAHEKYV6nsR2sTey8hNWHgs6dWK6dTYFm3fiA8CJMp05MyMH8kQ@mail.gmail.com>
My Ubuntu 16.04.6 LTS does think imap.gmail.com:993 is hostname.

raub@desktop:~$ (echo 'A CAPABILITY' && sleep 2) | gnutls-cli --crlf
imap.gmail.com:993
Processed 150 CA certificate(s).
Resolving 'imap.gmail.com:993'...
Cannot resolve imap.gmail.com:993:443: Name or service not known
raub@desktop:~$

and so does the box I created to suck mail (Centos 7.6):

[mailsucker@ mailbox ~]$  (echo 'A CAPABILITY' && sleep 2) |
gnutls-cli --crlf imap.gmail.com:993
Processed 151 CA certificate(s).
Resolving 'imap.gmail.com:993'...
Cannot resolve imap.gmail.com:993:443: Name or service not known
[mailsucker@ mailbox ~]$

I do not know why when I run gnutls-cli  in both my ubuntu and centos
box I am get the same result but completely different than others are.
Netcat (I have no telnet) has no issues reaching the gmail box though:

[mailsucker@mailbox ~]$ nc -tv imap.gmail.com 993
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 173.194.207.109:993.
^C
[mailsucker@ mailbox ~]$

Now, if I read the man page for gnutls-cli and learn about the --port
option, it works in the mailbox, meaning it can indeed reach gmail:

[mailsucker@mailbox ~]$  (echo 'A CAPABILITY' && sleep 2) | gnutls-cli
--crlf --port 993 imap.gmail.com
Processed 151 CA certificate(s).
Resolving 'imap.gmail.com'...
Connecting to '209.85.232.108:993'...
- Certificate type: X.509
- Got a certificate list of 2 certificates.
- Certificate[0] info:
 - subject `C=US,ST=California,L=Mountain View,O=Google
LLC,CN=imap.gmail.com', issuer `C=US,O=Google Trust Services,CN=Google
Internet Authority G3', RSA key 2048 bits, signed using RSA-SHA256,
activated `2019-01-29 14:59:34 UTC', expires `2019-04-23 14:59:00
UTC', SHA-1 fingerprint `aa5792751c19731c98c2fa5a6e6881506962dd89'
[...]

For the sake of completeness, I installed getmail in a vm I have in
the west coast (I am in the east coast), which should satisfy the
different network test. I kept the same layout as in my mailbox, and
ran the same config file. And got the same result I had in the
original post.

[raub@otherbox ~]$ getmail --getmaildir ~/mail/mailrc -r
~/mail/mailrc/getmailrc.gmail.raubvogel
getmail version 5.6
Copyright (C) 1998-2012 Charles Cazabon.  Licensed under the GNU GPL version 2.
SimpleIMAPSSLRetriever:[email protected]@imap.gmail.com:993:
read_all and not delete -- all messages will be retrieved each time
getmail is run
SimpleIMAPSSLRetriever:[email protected]@imap.gmail.com:993:
getmailrc.gmail.raubvogel: socket error (('The read operation timed out',))
  0 messages (0 bytes) retrieved, 0 skipped
[raub@otherbox ~]$

What is the minimum configuration I need for getmail to work? I still
think I am doing something wrong, or have a character in the config
that should not be there. After all, it worked before for me when I
sucked emails from another account.

On Mon, Feb 25, 2019 at 8:23 PM Gary R. Schmidt
<[email protected]> wrote:
>
> On 26/02/2019 10:52, Daniel Kahn Gillmor wrote:
> > On Mon 2019-02-25 08:57:15 -0600, Charles Cazabon wrote:
> >> I should have also said:
> >>
> >>>>> server = imap.gmail.com
> >>
> >> You could also try:
> >>
> >>      telnet imap.gmail.com 993
> >>
> >> If you don't more-or-less immediately see "Connected to <gmail-domain-name>",
> >> then the problem is that you've been blocked/firewalled off, either at your
> >> end or at Gmail's.
> >
> > The simple command-line test i'd expect to work is:
> >
> >    (echo 'A CAPABILITY' && sleep 2) | gnutls-cli --crlf imap.gmail.com:993
> >
> > If it works, you should see TLS connection information, followed by:
> >
> >      - Simple Client Mode:
> >
> > followed by something like:
> >
> >      * OK Gimap ready for requests from 38.109.115.130 l1mb154081195vke
> >      * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER AUTH=XOAUTH
> >      A OK Thats all she wrote! l1mb154081195vke
> >
> >
> > fwiw, this works fine for me right now, so i suspect the OP saw
> > something transient (or is experiencing a network blockage)
> >
> Didn't appear to work for me, maybe this is the OP's problem:
>
> $ (echo 'A CAPABILITY' && sleep 2) | gnutls-cli --crlf imap.gmail.com:993
> Error setting the x509 trust file
> Resolving 'imap.gmail.com:993'...
> Connecting to '74.125.68.108:993'...
> - Certificate type: X.509
> - Got a certificate list of 2 certificates.
> - Certificate[0] info:
>   - subject `CN=imap.gmail.com,O=Google LLC,L=Mountain
> View,ST=California,C=US', issuer `CN=Google Internet Authority
> G3,O=Google Trust Services,C=US', serial 0x43f0108801a59846, RSA key
> 2048 bits, signed using RSA-SHA256, activated `2019-01-29 14:59:34 UTC',
> expires `2019-04-23 14:59:00 UTC',
> pin-sha256="jybzA8WnUHxyKdRByYMbUoML2np36aMimGtBZreXhLk="
>          Public Key ID:
>                  sha1:3c767f63376e8c6e542d5f551786ca0b7e733b90
>
> sha256:8f26f303c5a7507c7229d441c9831b52830bda7a77e9a322986b4166b79784b9
>          Public Key PIN:
>                  pin-sha256:jybzA8WnUHxyKdRByYMbUoML2np36aMimGtBZreXhLk=
>          Public key's random art:
>                  +--[ RSA 2048]----+
>                  |              .o=|
>                  |             .. o|
>                  |          . .   o|
>                  |       . . o  ..o|
>                  |        S o o .o.|
>                  |       . + E o  .|
>                  |          . * B..|
>                  |             B.=.|
>                  |            o.o. |
>                  +-----------------+
>
> - Certificate[1] info:
>   - subject `CN=Google Internet Authority G3,O=Google Trust
> Services,C=US', issuer `CN=GlobalSign,O=GlobalSign,OU=GlobalSign Root CA
> - R2', serial 0x01e3a9301cfc7206383f9a531d, RSA key 2048 bits, signed
> using RSA-SHA256, activated `2017-06-15 00:00:42 UTC', expires
> `2021-12-15 00:00:42 UTC',
> pin-sha256="f8NnEFZxQ4ExFOhSN7EiFWtiudZQVD2oY60uauV/n78="
> - Status: The certificate is NOT trusted. The certificate issuer is
> unknown.
> *** PKI verification of server certificate failed...
> *** Fatal error: Error in the certificate.
>
>
> I also tried Charles' test:
>
> $ telnet imap.gmail.com 993
> Trying 74.125.24.109...
> Connected to gmail-imap.l.google.com.
> Escape character is '^]'.
> Connection to gmail-imap.l.google.com closed by foreign host.
>
> It's times like these I'm glad I don't rely on google.
>
>
>         Cheers,
>                 Gary    B-)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.