I’m sharing this as a fix I found for Roundcube SMTP authentication error.
Freedombox Version: Debian GNU/Linux trixie/sid and FreedomBox version 23.13. Roundcube Version: Roundcube Webmail 1.6-git
On Debian Testing, if Roundcube is updated, you will likely get an SMTP authentication failure message if trying to send e-mail.
To fix the error, I applied the following.
Edit the Roundcube configuration file with sudo nano /etc/roundcube/config.inc.php
Replace $config['smtp_host'] = 'localhost:587'; with $config['smtp_host'] = 'tls://%n:587';
Exit nano (ctrl+x) and restart apache with sudo systemctl restart apache2
Explanation:
Roundcube requires that smtp tls authentication aligns with your certificate. To provide this, I added tls:// followed by %n to specify my domain.
Good stuff man. Everything was working perfectly and then today I noticed that this error popped on me. I’m running Virtualmin 7.10.0 Pro with Ubuntu Linux 22.04.4 and Roundbox 1.6.1
Sweet! I am running an Ubuntu server and was plagued by botnet smtp auth attempts. So I turned off smtp auth on port 25, and turned on TLS on port 587 but then got the error described above. My config ddn’t work with %n, I had to use
$config[‘smtp_host’] = ‘tls://localhost:587’;
but glad to say it worked!
Thanks for posting!
Changing the line (and restarting apache) to either $config['smtp_server'] = 'tls://%n:587';
or $config['smtp_server'] = 'tls://localhost:587';
gives me the same error, thus I cannot longer use roundcube for sending e-mail (using sogo or an e-mail client works).
Thank you your answer. I am afraid, though, that this solution is not acceptable. Using port 25 is a security risk and, also, it can lead to my emails being blocked by recipient servers.
Using port 25 is not a security risk in this case, as the communication between Roundcube and the mail server never leaves the server. This won’t make other servers block you.