1

Topic: Roundcube unable to send to external SMTP server - Authentication fail

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
iRedMail version (check /etc/iredmail-release): 1.7.4 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version:  FreeBSD 14.3-RELEASE amd64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
====

I want to have mail from roundcube sent directly to an external SMTP mail host, with the mail username and password stored in roundcube. Using username and password that works just fine from Thunderbird, I get "Authentication failure" from roundcube.

In Thunderbird the settings are "Connection Security: SSL/TLS" and "Authentication method: Normal password".

Here are my settings from /usr/local/www/roundcube/config/config.inc.php:

$config['smtp_host'] = 'ssl://relayhost.com:465';
$config['smtp_port'] = '465';
$config['smtp_user'] = 'fie@foe.com';
$config['smtp_pass'] = '#############';
$config['smtp_auth_type'] = null;
$config['smtp_conn_options'] = null;
$config['smtp_helo_host'] = 'me.com';
$config['smtp_xclient_addr'] = false;
$config['smtp_xclient_login'] = false;
$config['smtp_auth_cid'] = null;
$config['smtp_auth_pw'] = null;

Any suggestions?

    Julf

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Roundcube unable to send to external SMTP server - Authentication fail

The Thunderbird settings indicate "Normal password" authentication, which typically corresponds to the LOGIN or PLAIN authentication method in Roundcube.

You could try to modify the smtp_auth_type in the Roundcube configuration file to explicitly specify the authentication method. Since Thunderbird uses "Normal password," try setting smtp_auth_type to 'LOGIN' or 'PLAIN'.

Update the configuration:

$config['smtp_auth_type'] = 'LOGIN'; // or 'PLAIN' if LOGIN doesn't work

To diagnose the issue further, enable SMTP debugging in Roundcube to log detailed error messages.
Add or modify the following in the config file:

$config['smtp_debug'] = true;

After enabling debugging, try sending an email via Roundcube. Check the Roundcube logs for specific error messages from the SMTP server. This may reveal details about why authentication is failing (e.g., incorrect auth method, blocked IP, etc.).

3

Re: Roundcube unable to send to external SMTP server - Authentication fail

coralsnake wrote:

The Thunderbird settings indicate "Normal password" authentication, which typically corresponds to the LOGIN or PLAIN authentication method in Roundcube.

You could try to modify the smtp_auth_type in the Roundcube configuration file to explicitly specify the authentication method. Since Thunderbird uses "Normal password," try setting smtp_auth_type to 'LOGIN' or 'PLAIN'.

Thanks - tried both, still failure.

coralsnake wrote:

After enabling debugging, try sending an email via Roundcube. Check the Roundcube logs for specific error messages from the SMTP server. This may reveal details about why authentication is failing (e.g., incorrect auth method, blocked IP, etc.).

Here is the log:

Jun 16 15:31:16 postman roundcube[21331]: <5bcs549g> Connecting to ssl://mailhost.com:465...
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 220 mailhost.com ESMTP
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Send: EHLO me.com
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-mailhost.com
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-PIPELINING
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-SIZE 37033449
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-AUTH PLAIN LOGIN
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-AUTH=PLAIN LOGIN
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-ENHANCEDSTATUSCODES
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-8BITMIME
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250-DSN
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 250 CHUNKING
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Send: AUTH LOGIN
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 334 XXXXXXXX
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Send: YYYYYYYY==
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Recv: 334 ZZZZZZZZ
Jun 16 15:31:17 postman roundcube[21331]: <5bcs549g> Send: ****** [24]
Jun 16 15:31:19 postman roundcube[21331]: <5bcs549g> Recv: 535 5.7.8 Error: authentication failed:
YYYYYYYYY
Jun 16 15:31:19 postman roundcube[21331]: <5bcs549g> PHP Error: Invalid response code received from
 server (POST /mail/?_task=mail&_unlock=loading1750087876696&_framed=1&_action=send)
Jun 16 15:31:19 postman roundcube[21331]: <5bcs549g> Send: QUIT
Jun 16 15:31:19 postman roundcube[21331]: <5bcs549g> Recv: 221 2.0.0 Bye
Jun 16 15:31:19 postman roundcube[21331]: <5bcs549g> SMTP Error: Authentication failure: 5.7.8 Error: authentication failed: YYYYYYYYY (Code: 535) in /usr/local/www/roundcube/program/lib/Roundcube/rcube.php on line 1795 (POST /mail/?_task=mail&_unlock=loading1750087876696&_framed=1&_action=send)

4

Re: Roundcube unable to send to external SMTP server - Authentication fail

Log shows that the connection is established, and server sends compatible Authentication type PLAIN or LOGIN

The server still responds with 535 5.7.8 Error: authentication failed:

This should rather point to an incorrect username or password.
Special characters in the password (e.g., !, @, #) might be interpreted differently by Roundcube compared to Thunderbird, especially during Base64 encoding. To rule this out, test with a simple alphanumeric password (e.g., test1234) and revert to the original password afterward.

5

Re: Roundcube unable to send to external SMTP server - Authentication fail

coralsnake wrote:

This should rather point to an incorrect username or password.
Special characters in the password (e.g., !, @, #) might be interpreted differently by Roundcube compared to Thunderbird, especially during Base64 encoding. To rule this out, test with a simple alphanumeric password (e.g., test1234) and revert to the original password afterward.

Tried that - and it worked! But then I changed back to the more complex password, and it also worked!

Embarrassingly enough, it seems I must have had some error in the original password, despite checking it a gazillion times.

Thanks for the help!

     Julf