msikma
April 27th, 2020, 07:41 PM
Hi there. I've been setting up Ubuntu 20.04 LTS as a new webserver. It's working very well, I've got Apache/PHP/MySQL set up and I'm now setting up a wiki for a project.
However, I ran into a problem. To get email sending working, I've set up a new Gmail account and created an app password, but for some reason I'm completely unable to even connect to smtp.google.com.
I've made a test script (https://gist.github.com/msikma/5d30861c156bf499e0112020ab350415) (uses PHP-Pear) that works correctly on my local machine. It runs, and sends a new email through the which I receive in the expected mail address, so it runs fine.
But when I run that test script on my Ubuntu server, it times out saying:
Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: Connection timed out (code: -1, response: )]
It even does this when I disable ufw completely, somehow.
Would anyone happen to know what could be wrong?
Note: I can't even telnet to the server, somehow. On my local machine, it does work:
$ telnet smtp.gmail.com 465
Trying 64.233.166.109...
Connected to smtp.gmail.com.
Escape character is '^]'.
Connection closed by foreign host.
On my server:
$ telnet smtp.gmail.com 465
Trying 2a00:1450:400c:c08::6d...
Trying 74.125.140.109...
telnet: Unable to connect to remote host: Connection timed out
So I'm not sure, maybe I need to contact my host (Linode), but then maybe I am missing something in my setup. Appreciate any help!
edit:
I think maybe all email traffic is being blocked by Linode as a policy, and I didn't realize it from the feedback I was getting from my tests. I've opened a support ticket for that. But who knows, if anyone notices something else that I can check, please let me know. :)
However, I ran into a problem. To get email sending working, I've set up a new Gmail account and created an app password, but for some reason I'm completely unable to even connect to smtp.google.com.
I've made a test script (https://gist.github.com/msikma/5d30861c156bf499e0112020ab350415) (uses PHP-Pear) that works correctly on my local machine. It runs, and sends a new email through the which I receive in the expected mail address, so it runs fine.
But when I run that test script on my Ubuntu server, it times out saying:
Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: Connection timed out (code: -1, response: )]
It even does this when I disable ufw completely, somehow.
Would anyone happen to know what could be wrong?
Note: I can't even telnet to the server, somehow. On my local machine, it does work:
$ telnet smtp.gmail.com 465
Trying 64.233.166.109...
Connected to smtp.gmail.com.
Escape character is '^]'.
Connection closed by foreign host.
On my server:
$ telnet smtp.gmail.com 465
Trying 2a00:1450:400c:c08::6d...
Trying 74.125.140.109...
telnet: Unable to connect to remote host: Connection timed out
So I'm not sure, maybe I need to contact my host (Linode), but then maybe I am missing something in my setup. Appreciate any help!
edit:
I think maybe all email traffic is being blocked by Linode as a policy, and I didn't realize it from the feedback I was getting from my tests. I've opened a support ticket for that. But who knows, if anyone notices something else that I can check, please let me know. :)