# \[SOLVED\] Roundcube SMTP Authentication Error Fix

**URL:** <https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676>\
**Category:** Support\
**Created:** [July 25, 2023, 7:34pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676 "2023-07-25T19:34:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ged](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/ged/32/999_2.png) [@Ged](https://discuss.freedombox.org/u/Ged)\
**Post date:** [July 25, 2023, 7:34pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/1 "2023-07-25T19:34:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gmgarciam](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@gmgarciam](https://discuss.freedombox.org/u/gmgarciam)\
**Post date:** [May 7, 2024, 8:31pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/2 "2024-05-07T20:31:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roman](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@roman](https://discuss.freedombox.org/u/roman)\
**Post date:** [December 19, 2024, 4:09pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/3 "2024-12-19T16:09:45Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![antidoto](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@antidoto](https://discuss.freedombox.org/u/antidoto)\
**Post date:** [April 1, 2025, 12:39pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/4 "2025-04-01T12:39:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![David](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://discuss.freedombox.org/u/David)\
**Post date:** [April 1, 2025, 2:11pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/5 "2025-04-01T14:11:22Z")

</div>

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:

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

```

there change the setting under SMTP host to port 25

```auto
$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.

---

<div class="post-metadata">

**Author:** ![antidoto](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@antidoto](https://discuss.freedombox.org/u/antidoto)\
**Post date:** [April 1, 2025, 5:42pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/6 "2025-04-01T17:42:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nbenedek](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/nbenedek/32/1220_2.png) [@nbenedek](https://discuss.freedombox.org/u/nbenedek)\
**Post date:** [April 1, 2025, 8:38pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/7 "2025-04-01T20:38:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![antidoto](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@antidoto](https://discuss.freedombox.org/u/antidoto)\
**Post date:** [April 3, 2025, 8:23am UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/8 "2025-04-03T08:23:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LFRX](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/lfrx/32/1577_2.png) [@LFRX](https://discuss.freedombox.org/u/LFRX)\
**Post date:** [October 1, 2025, 12:16am UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/9 "2025-10-01T00:16:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![David](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://discuss.freedombox.org/u/David)\
**Post date:** [October 1, 2025, 2:04pm UTC](https://discuss.freedombox.org/t/solved-roundcube-smtp-authentication-error-fix/2676/10 "2025-10-01T14:04:10Z")

</div>

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.
