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

2

5

im 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. Im on debian 9.

my ~/.muttrc setting are

set realname = "my name"

set from = "[email protected]"
set use_from = yes
set envelope_from = yes

set smtp_url = "smtps:// [email protected]@smtp.gmail.com:465/"
set smtp_pass = "mypassword"
set imap_user = "[email protected]"
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

Farcy answered 21/5, 2019 at 11:23 Comment(0)
P
5

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:

  • a firewall prevents port 465 from going through
  • the port number is incorrect
Push answered 21/5, 2019 at 11:45 Comment(2)
i´ve done both these steps, i get a normal response from the ping but i get no response when i try to telnet port 465 or port 587. What is confusing me is that 1 week ago this ran fine and im pretty sure that nothing in my network changed.Do you have any tips of things i could try to find a resolutionFarcy
ok ive looked around and i think that something happened with the ports that my pc has open, how would i open port 465 ,587 and 993Farcy
C
2

I had a similar issue when working on Zammad Helpdesk and Ticketing System.

The issue was that I had a security policy on my server on Amazon Web Services that blocked/refused the Application to send requests to ports that are not allowed on the server.

So since ports 993 for imap.gmail.com, 995 for pop.gmail.com and 465 or 587 for smtp.gmail.com are not allowed on by the security policy on the server, connections to them will not be permitted, which led to the issue:

Host not reachable!

I resolved it by simply opening the ports/allowing connections requests to those ports on the server's security policy.

That's all.

I hope this helps.

Confetti answered 5/3, 2020 at 13:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.