Can't connect to external SMTP server

System Details:

OS: Ubuntu Linux 18.04.5, Webmin: 1.973, Virtualmin: 6.15, Usermin: 1.823, Authentic Theme: 19.73


I have a few VPSs (all of them uses the same OS) and they all have the same Virtualmin+Webmin versions installed. The Webmin and Virtualmin settings too are the same on all of them.

For some weird reason, one of the servers can’t connect to external SMTP servers even though I’ve checked and confirmed that the Postfix and Dovecot settings are set up in the same way as on the other servers.

I have a dummy WordPress site on the server that I have configured to send mail via SMTP (manually setting SMTP up by configuring wp_mail as well as using an SMTP plugin) but test mails sent from the site are not delivered.

However, when I do the same thing (using wp_mail or SMTP plugin) on live WordPress sites hosted on the other servers, the test mails are delivered without a problem.

Running “re-checking configuration” returns no errors and I tried checking the mail logs in /var/log/mail.log but there isn’t anything useful there too other than a few lines about brute-force login attempts (SASL LOGIN authentication failed).

What could be causing this particular server to be unable to connect to external SMTP servers?

Just wanted to add that when I send emails from the server directly and not via SMTP, the emails are delivered normally though.

Hi,

Yet, it should be logged. Perhaps you’re not looking at the right logs?

Please double check that saslauthd service is running and/or restart it manually and that mail for domain feature is enabled on Edit Virtual Server page.

Hey there @Ilia

Running service saslauthd status returns the following active status as well as some authentication errors:

● saslauthd.service - LSB: saslauthd startup script
   Loaded: loaded (/etc/init.d/saslauthd; generated)
   Active: active (running) since Mon 2021-03-29 18:58:58 UTC; 2 days ago
     Docs: man:systemd-sysv-generator(8)
  Process: 165 ExecStart=/etc/init.d/saslauthd start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/saslauthd.service
           ├─210 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 2
           └─211 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 2

Apr 01 06:14:47 vps1.example.com saslauthd[211]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Apr 01 06:14:47 vps1.example.com saslauthd[211]:                 : auth failure: [user=fds@example.com] [service=smtp] [realm=example.com] [mech=pam] [reason=PAM auth e
Apr 01 06:14:47 vps1.example.com saslauthd[210]: pam_unix(smtp:auth): check pass; user unknown
Apr 01 06:14:47 vps1.example.com saslauthd[210]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Apr 01 06:14:49 vps1.example.com saslauthd[211]: pam_unix(smtp:auth): check pass; user unknown
Apr 01 06:14:49 vps1.example.com saslauthd[211]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Apr 01 06:14:50 vps1.example.com saslauthd[210]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Apr 01 06:14:50 vps1.example.com saslauthd[210]:                 : auth failure: [user=fhg3@example.com] [service=smtp] [realm=example.com] [mech=pam] [reason=PAM auth
Apr 01 06:14:51 vps1.example.com saslauthd[211]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Apr 01 06:14:51 vps1.example.com saslauthd[211]:                 : auth failure: [user=design] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]

Could SASL be the cause for this issue maybe?

I hate to do this as it’s a workaround to the problem and not an actual fix for your server, but install this Wordpress plugin and see if it works.

If it does you can at least use it until you get the actual server issue solved.

@Gomez_Adams That is the same SMTP plugin that I used on the other servers as well as the one I tried on this server lol The server as well as the WordPress sites on it can’t connect to external SMTP servers (self-hosted mailservers or providers like Google, SendGrid, Sendinblue etc) even though the Postfix configuration is exactly the same as on the other Virtualmin+Webmin servers that I have with SMTP working.

System notifications from Webmin for example, are not getting delivered when I try to send them via SMTP either.

And my mail.log doesn’t show anything related to this SMTP issue other than lines about failed login attempts by bots every now and then.

So what does the error log in the Plugin Itself tell you? Not the server log, the plugin log.

@Gomez_Adams When I try to send a test email using the Email Test available in the WP MAIL SMTP plugin, the page just keeps on loading for a while and then the browser shows a Timeout error.

@Gomez_Adams I don’t have the WP Mail SMTP Pro version unfortunately. I’m using the free version without the email logs feature.

That may be the problem. I think that plugin is limited if it’s not the pro version. If they see multiple instances running that plugin through the same IP I think they limit it unless you upgrade to the pro version.

The server itself can’t connect to external SMTP so I doubt it’s a WordPress related issue tbh.

Would resetting the postfix config fix this maybe?