mutt

Mutt- Could not connect to smtp.gmail.com (network is unreachable)


I'm trying to use mutt to send an email with one attachment, and i keep getting the error

could not connect to smtp.gmail.com (Network is unreachable).

one thing to note is that one week ago i tried to send email with the exact settings on my muttrc file and it worked fine. I'm on Debian 9.

my ~/.muttrc setting are

set realname = "my name"

set from = "user@gmail.com"
set use_from = yes
set envelope_from = yes

set smtp_url = "smtps:// user@gmail.com@smtp.gmail.com:465/"
set smtp_pass = "mypassword"
set imap_user = "user@gmail.com"
set imap_pass = "mypassword"
set folder = "imaps://imap.gmail.com:933"
set spoolfile = "+INBOX"
set ssl_starttls = yes
set ssl_force_tls = yes

bind index G imap-getch-mail
set editor = "vim"
set charset = "utf-8"
set record = ''

Also I read online that google sometimes becomes unreachable or something like that, if that were the case I would like someone to tell me how can I tell when this is the case.


Solution

  • To investigate this:

    First check if the remote host is reachable with ping:

    $ ping smtp.gmail.com
    PING gmail-smtp-msa.l.google.com (108.177.15.109) 56(84) bytes of data.
    64 bytes from wr-in-f109.1e100.net (108.177.15.109): icmp_seq=1 ttl=35 time=39.6 ms
    

    Ok.

    Then check if it can be reached on port 465 :

    $ telnet smtp.gmail.com 465
    Trying 108.177.15.109...
    (no response)
    

    There a several possible reasons why port 465 cannot be reached: