Cannot open a connection to the mailserver smtp.sendgrid.net:587

Hi,
I am using Ubuntu 22.04 with the latest CyberPanel
Current Version: 2.3
Build: 4
Current Commit: 2b7c8104b47669c609a28e468bbd435e

Today, I installed Monit to monitor my VPS but I always get the error below and Monit can’t send out the alert emails.

[2023-05-09T12:53:09+0000] error    : Mail: Delivery failed -- no mail server is available
[2023-05-09T12:53:09+0000] error    : Alert handler failed, retry scheduled for next cycle
[2023-05-09T12:56:09+0000] error    : Cannot connect to [smtp.sendgrid.net]:587 -- Connection timed out
[2023-05-09T12:56:09+0000] error    : Cannot open a connection to the mailserver smtp.sendgrid.net:587 -- Operation now in progress
[2023-05-09T12:56:09+0000] error    : Mail: Delivery failed -- no mail server is available
[2023-05-09T12:56:09+0000] error    : Alert handler failed, retry scheduled for next cycle
[2023-05-09T12:59:09+0000] error    : Cannot connect to [smtp.sendgrid.net]:587 -- Connection timed out
[2023-05-09T12:59:09+0000] error    : Cannot open a connection to the mailserver smtp.sendgrid.net:587 -- Operation now in progress
[2023-05-09T12:59:09+0000] error    : Mail: Delivery failed -- no mail server is available
[2023-05-09T12:59:09+0000] error    : Alert handler failed, retry scheduled for next cycle

Why the system can’t connect to smtp.sendgrid.net]:587?

Note: It’s working very well on Debian 11 but didn’t work on Ubuntu 22.04 with CyberPanel

Please advise

Thanks

Run command
telnet SMTP.sendgrid.net 587
and share the result

The result:

Trying 52.220.95.193…
Trying 13.114.210.107…
telnet: Unable to connect to remote host: Connection timed out

Thank you

It seems you are using firewall on server or hosting provider end, please add tcp port 587 for outgoing.

I contacted the provider and they have blocked ports 587, 25 and 465.

They unblocked those ports for me.

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.