Authentication errors are always annoying, especially when you’re sure the logins are correct.
One such error in Roundcube is “SMTP error 250 authentication failed“.
This usually happens when customers try to send emails from their Roundcube webmail client.
At Bobcares, we resolve these email errors as part of Dedicated Support Services to our customers.
Today, we’ll discuss the top 3 reasons for this error and how we fix them.
Roundcube SMTP error 250 authentication failed – A Brief idea
Most web hosts now use SMTP AUTH on their servers. This prevents the server from being used as open relays and spam.
SMTP authentication allows the email sender to login to the email server using an authentication mechanism. In other words, only trusted users can send data via the SMTP server.
Customers usually see this error when they try to send emails using Roundcube email client. For instance, the complete error looks like this:
An error has occurred! SMTP Error (250): Authentication failed.
So, our Support Experts check the mail server logs(/var/log/maillog or /var/log/exim_mainlog) and roundcube error logs. In addition to that, we enable SMTP debugging in roundcube configuration file. For example, on Plesk servers, we add the following code in the roundcube configuration file /usr/share/psa-roundcube/config/defaults.inc.php to enable SMTP debugging.
$config['debug_level'] = 1;
$config['smtp_debug'] = true;
This helps us to identify the origin of the issue.
Roundcube SMTP error 250 authentication failed – Causes & Fixes
Now, let’s see the common reasons for this error and how our Dedicated Engineers fix them.
1) Incorrect authentication settings in SMTP server
Roundcube SMTP error 250 authentication failed usually occurs when there is incorrect SMTP authentication setting in the email server configuration.
For example, one of the common mistakes that we see on Postfix servers is that users enable complex authentication methods such as CRAM MD5 in Postfix mail server. But, Roundcube doesn’t support this authentication. That is, users set the following authentication option in Postifx configuration file /etc/postifx/main.cf.
smtpd_sasl_security_options = noanonymous, noplaintext
This means that the server won’t support normal authentication mechanisms such as LOGIN, PLAIN, etc and roundcube throws this error.
Similarly, on Plesk servers, we’ve seen instances where Postifx is configured for SMTP authentication over TLS, but it’s not configured correctly. This can also create problems.
How we fix?
In such cases, our Support Engineers fix this by enabling PLAIN and LOGIN authentication mechanisms. For example, on Postfix servers, we add the following line.
smtpd_sasl_security_options = noanonymous
Customers can then login and send emails via Roundcube using the username and password.
Moreover, on Plesk servers, we ensure that SMTP authentication is enabled from Tools & Settings > Mail Server Settings > Relay options > Relaying.
In addition to that, we enable SMTP service on port 587 for all IPs from Tools & Settings > Mail Server Settings.
Also, we make sure that the following parameters are disabled in the Postifx configuration file.
smtpd_tls_exclude_ciphers
smtpd_sasl_security_options
smtpd_tls_auth_only
tls_ssl_options
2) Certificate mismatch issues
This usually happens when the mail server is configured to use SSL/TLS, but roundcube is not configured to use the proper certificate.
For example, one of the common mistakes that we see on cPanel servers is that customers setup Roundcube to use TLS for sending.
$config['smtp_server'] = 'tls://localhost;
However, this can sometimes conflicts with the SSL host value in /etc/exim.cert file and create problems.
How we fix?
In such case, our Support Engineers add the server hostname in the Rouncube configuration file.
$config['smtp_server'] = 'tls://serverhostname.com';
Therefore, we confirm that the hostname matches the SSL host in /etc/exim.cert file.
3) Roundcube configuration issues
Most web hosts use port 587 for SMTP authentication. We’ve seen instances where roundcube configuration settings aren’t properly configured to support SMTP authentication.
How we fix?
Here, our Support Engineers ensure that Roundcube is configured properly to support SMTP authentication. Most importantly, we make sure that the following parameters in Roundcube configuration file config.inc.php are set correctly.
$config['default_host'] = 'tls://server.hostname.com';
$config['smtp_port'] = 587;
$config['smtp_auth_type'] = 'LOGIN';
In addition to that, we tweak the following entries in Roundcube configuration file.
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
In the above setting, Rouncube uses the current user and current user’s password for logging in. This can sometimes create problems. So, for a safer side, we set blank entries for these parameters.
$config['smtp_user'] = ' ';
$config['smtp_pass'] = ' ';
[Need an Expert to look into your annoying email errors? Our Support Engineers are here 24/7].
Conclusion
In short, roundcube SMTP error 250 authentication failed can mainly occur due to SMTP authentication settings in the mail server or in the Roundcube email client. Today, we’ve discussed the main reasons for this error and how our Dedicated Engineers fix them.
I’m not all that excited about your suggestions of PLAIN and blank u/p, but you hit the nail on the head with using FQDN in the host fields. “localhost” isn’t likely in your cert, but “mail.mydomain.com” is, so use a name that’s in the cert.
Exactly. Solved my problem as well. Thank you.
Thanks a lot. Finally I have my Roundcube + Postfix3 + Dovecot working fine with ssl and disabling 143 port (SSL auth only)
In Roundcube could be possible to execute “bin/update.sh” – this could be fixed also some problems with configuration and other issues like SMTP error. Some naming config option has been changed.
< $config['smtp_host'] = 'localhost'; $config[‘smtp_server’] = ‘localhost’; <= old option
Thanks a bunch, Bob, this solved my issue.
I actually had
$config[‘smtp_server’] = ‘localhost;
in my config, but since postfix offers AUTH only after STARTTLS, roundcube threw me the error. Change to tls:// and the FQDN and now it works like a charm.
Thanks Bob
Cheers from Germany
Hi Bernd,
Thanks for the feedback. We are glad to know that our article helps you solves the issue 🙂 .