0

stream_socket_client(): Unable to connect to tcp://gmail-smtp-in.l.google.com:25

 stream_socket_client("tcp://gmail-smtp-in.l.google.com:25", $errno, $errstr, 30)

ufw status root@XXXXX:~# sudo ufw status Status: active

To Action From


Nginx HTTP ALLOW Anywhere
Nginx HTTPS ALLOW Anywhere
22/tcp ALLOW Anywhere
22/tcp ALLOW 00.000.000.000
80/tcp ALLOW Anywhere
443 ALLOW Anywhere
443/tcp ALLOW Anywhere
53 ALLOW Anywhere
3306/tcp ALLOW Anywhere
25 ALLOW Anywhere
23/tcp ALLOW Anywhere
Nginx HTTP (v6) ALLOW Anywhere (v6)
Nginx HTTPS (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
53 (v6) ALLOW Anywhere (v6)
3306/tcp (v6) ALLOW Anywhere (v6)
25 (v6) ALLOW Anywhere (v6)
23/tcp (v6) ALLOW Anywhere (v6)

25/tcp ALLOW OUT Anywhere
25/tcp (v6) ALLOW OUT Anywhere (v6)

  • In short: access to port 25 is likely blocked by your hosting provider to prevent sending spam. For sending mail you normally should not try to send unauthenticated mail directly to the MX of the domain but use an account at your mail provider instead. – Steffen Ullrich Aug 01 '23 at 08:28
  • I was going to say...why are you trying to create a raw socket connection to the SMTP server anyway?? – ADyson Aug 01 '23 at 09:44
  • P.S. Anyway it's likely these ufw rules show rules about _incoming_ connections. That has nothing to do with whether you can make an _outgoing_ connection on any of these ports. Use `sudo ufw status verbose` to see all rules and check whether they are inbound or outbound (ref: https://linuxhint.com/ufw_list_rules/) – ADyson Aug 01 '23 at 09:46

0 Answers0