[SOLVED] Roundcube SMTP Authentication Error Fix

Hello,

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.

  1. Edit the Roundcube configuration file with sudo nano /etc/roundcube/config.inc.php
  2. Replace $config['smtp_host'] = 'localhost:587'; with $config['smtp_host'] = 'tls://%n:587';
  3. 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.

Hope this helps anyone that comes along.

2 Likes

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

1 Like

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!

1 Like

I have the same problem as I get

SMTP Error (): Authentication failed.

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).

Hi

I’ve had the same error when I first did setup the email server.

This did solve the problem, since Roundcube is on the same server like Postfix/Dovecot:

sudo nano /etc/roundcube/config.inc.php

there change the setting under SMTP host to port 25

$config['smtp_host'] = 'localhost:25';

I have found this solution on the FreedomBox under Apps > Postfix/Dovecot, enlarge the description and you will find it at almost the end of it.

1 Like

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.

3 Likes

Oh! I didn’t knew that this happens internally. Thank you, both!

I had to do this too,
Is it gonna get fixed?

Welcome Lukas!

I don’t know if this needs a fix, because for some other setups it might be proper (I’m guessing)…
Since SOGo is available in FreedomBox, I use SOGo. It works perfect with Postfix/Dovecot together and has Caldav and Carddav included. So no need for Radicale for your Contacts, Todo List and Calendar. And SOGo is easier to administer imports and exports, plus some other features that are preferred. Still, I like Roundcube and Radicale, nothing against these Apps.