sSMTP: Unable to locate/open Mail

Hello,

I have installed VitalPBX on a Dedicated Server hosted by Hetzner.
Everything seems working, but no emails get sent. When I’m trying to send an email to test the settings, I get an error saying the mail could not be sent.
When I was checking the email log via web interface, I noticed following errors:

Jul 6 14:22:20 pbxname sSMTP[5032]: Unable to locate mail
Jul 6 14:22:20 pbxname sSMTP[5032]: Cannot open mail:25

To exclude a misconfiguration on our Server, I installed VitalPBX on another VPS via the provided script. The errors are the same:

Jul 6 12:28:15 vpbx-test-ubnt-4gb-fsn1-1 sSMTP[8430]: Unable to locate mail
Jul 6 12:28:15 vpbx-test-ubnt-4gb-fsn1-1 sSMTP[8430]: Cannot open mail:25

After that I installed VitalPBX on another VPS, provided by ionos, a different hoster.
I was running the same script and configured same options as done before. While testing the settings, I wondered the email got sent successfully:

Jul 6 12:47:40 localhost postfix/postfix-script[2183]: starting the Postfix mail system
Jul 6 12:47:40 localhost postfix/master[2185]: daemon started -- version 2.10.1, configuration /etc/postfix
Jul 6 12:47:40 localhost postfix/qmgr[2187]: 1B853809C16: from=<domain.de>, size=757, nrcpt=1 (queue active)
Jul 6 12:47:40 localhost postfix/smtp[2192]: 1B853809C16: to=<admin@domain.de>, relay=smtp.ionos.de[213.165.67.97]:587, delay=16, delays=16/0.04/0.07/0.03, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=1MUD7D-1o0eUh46MN-123)
Jul 6 12:47:40 localhost postfix/qmgr[2187]: 1B853809C16: removed
Jul 6 12:47:43 localhost postfix/pickup[2186]: 77CF2809C16: uid=48 from=<apache>
Jul 6 12:47:43 localhost postfix/cleanup[2197]: 77CF2809C16: message-id=<1234567890@localhost.localdomain>
Jul 6 12:47:43 localhost postfix/qmgr[2187]: 77CF2809C16: from=<admin@domain.de>, size=757, nrcpt=1 (queue active)
Jul 6 12:47:43 localhost postfix/smtp[2192]: 77CF2809C16: to=<admin@domain.de>, relay=smtp.ionos.de[213.165.67.113]:587, delay=0.08, delays=0.01/0/0.05/0.02, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=1MQ5nK-1nvxPT2Gfo-123)
Jul 6 12:47:43 localhost postfix/qmgr[2187]: 77CF2809C16: removed

The hosting company of the servers whose emails aren’t sent guaranteed nothing is blocked by them.
I noticed that Hetzner by default is changing the Computername during the installation of the OS, because the above log shows „localhost“ instead of a customized name.

Would it be possible that this might be responsible for the error?

Furthermore I tried to restart the service via following commands without success:

> postsuper -d ALL (even though there weren’t any emails to discard)
> systemctl restart postfix.service

The PBX running in a productive environment is running Asterisk 18.10.0 and VPBX 3.2.1-1.
The test system is running VPBX 3.2.2-1. During writing I noticed that the dashboard of the PBX in productive use (darkmode) is showing “pbxname”, while the dashboard on the test system is showing VitalPBX:

I would appreciate any ideas how fix this error can be fixed.

Thank you in advance!

Best Regards

What are your email settings on the Hetzner servers with the errors. From the very small log, seems you are tyring to use port 25? On your ionos server, you seem to be using the provideres smtp server (smtp.ionos.de) and you are using port 587. Are you using different smtp server on the servers?

SSH the server

Run following command
yum remove ssmtp
or
sudo apt-get remove ssmtp
or
sudo apt-get remove --auto-remove ssmtp

once ssmtp is removed
install postfix
Run command

sudo yum install postfix
systemctl enable postfix
systemctl restart postfix

reboot
Reboot the server ( You can do that from GUI also)
Now you should be able to configure mail settings through GUI

2 Likes

Why and when does this happen? Is it because it was a preconfigured CentOS by the hoster?

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