Roundcube Community Forum

Release Support => Release Discussion => Topic started by: maximise on February 07, 2019, 06:10:30 AM

Title: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 07, 2019, 06:10:30 AM
Hello.
Roundcube is configured like this:

$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['smtp_auth_type'] = '';
$rcmail_config['smtp_auth_cid'] = null;
$rcmail_config['smtp_auth_pw'] = null;
$rcmail_config['smtp_helo_host'] = 'localhost.localdomain';
$rcmail_config['smtp_timeout'] = 0;

when trying to send mail, an error occurs:
SMTP Error: SMTP error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/roundcubemail/program/include/rcmail.php on line  (POST /mail/?_unlock=loading1369676645733&_lang=ru?_task=mail&_action=send)

Please, help.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on February 07, 2019, 08:38:03 AM
your SMTP server does not support authentication so you should set:

$rcmail_config['smtp_user'] = '';
$rcmail_config['smtp_pass'] = '';

PS. what version of roundcube are you running? $rcmail_config was depreciate and replaced with $config in version 1.0
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 08, 2019, 01:17:58 AM
Roundcube 1.3.8.
I tried
$rcmail_config['smtp_user'] = '';
$rcmail_config['smtp_pass'] = '';

And now messages are sent, but inbox of addressee are empty. Why?
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: alec on February 08, 2019, 03:17:43 AM
Authentication might be disabled on insecure channel. I would rather propose to try with:
$rcmail_config['smtp_server'] = 'tls://localhost';
$rcmail_config['smtp_port'] = 587;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 08, 2019, 03:53:49 AM
Authentication might be disabled on insecure channel. I would rather propose to try with:
$rcmail_config['smtp_server'] = 'tls://localhost';
$rcmail_config['smtp_port'] = 587;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';

I tried that. As a result, there was another error sending the message.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 11, 2019, 08:51:27 AM
Please help
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on February 12, 2019, 02:35:44 AM
Quote
And now messages are sent, but inbox of addressee are empty. Why?
I'm sorry but I'm not sure what this means, please could you explain a little more?
Quote
I tried that. As a result, there was another error sending the message.
What error?

Are you sure your SMTP server is working correctly, are you able to send messages with other clients? If so have you checked the SMTP server log for more details when trying to send messages using roundcube. Also you could turn on smtp_debug in the roundcube config and check that log for any more details.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 13, 2019, 03:27:22 AM
Quote
And now messages are sent, but inbox of addressee are empty. Why?
I'm sorry but I'm not sure what this means, please could you explain a little more?
Quote
I tried that. As a result, there was another error sending the message.
What error?

smtp error (250) authentication failed

Quote
Are you sure your SMTP server is working correctly, are you able to send messages with other clients? If so have you checked the SMTP server log for more details when trying to send messages using roundcube. Also you could turn on smtp_debug in the roundcube config and check that log for any more details.

My SMTP server is localhost. I tried from differents accounts.
when trying to send mail, an error occurs:
SMTP Error: SMTP error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/roundcubemail/program/include/rcmail.php on line  (POST /mail/?_unlock=loading1369676645733&_lang=ru?_task=mail&_action=send)
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on February 15, 2019, 02:32:23 AM
Are you sure your SMTP server is working correctly?
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 18, 2019, 06:23:12 AM
Are you sure your SMTP server is working correctly?

I don't know.  :-\ :(
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 20, 2019, 03:20:22 AM
Hello again. This promblem still here  :(

If my config are:
$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';

Then I have a SMTP Error (250): Authentication failed?
log: SMTP Error: SMTP error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/roundcubemail/program/include/rcmail.php on line  (POST /mail/?_unlock=loading1369676645733&_lang=ru?_task=mail&_action=send)

If my config are:
$rcmail_config['smtp_user'] = '';
$rcmail_config['smtp_pass'] = '';

Then messages are sent, but the recipient does not receive the email message.

Also recipient does not receive the email message from another emails (not mydomain).

P.S. I found two files of config (config.inc and defaultts.inc) , but I think its not a problem.

Pls help with this.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on February 20, 2019, 04:46:56 AM
Quote
Then messages are sent, but the recipient does not receive the email message.
Have you checked your SMTP logs to see what happened to the message after it left Roundcube?
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 20, 2019, 06:26:07 AM
Quote
Then messages are sent, but the recipient does not receive the email message.
Have you checked your SMTP logs to see what happened to the message after it left Roundcube?

In errors of roundcube nothing

In "sendmail" :

[20-Feb-2019 11:08:23 +0300]: <sa3b> User admin@*** [192.168.XX]; Message for admin@***; 250: 2.0.0 Ok: queued as CD77522C30
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on February 20, 2019, 09:22:52 AM
It sounds like roundcube is working properly and that log entry says that sendmail queued the message for delivery. I think you are going to have to keep tracing the message through the delivery process to find out where its gone. Perhaps the sendmail community can help you.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: larryjhammondd on February 21, 2019, 01:47:35 AM
Turn on debugging and check the Roundcube logs. Maybe you overwrote your config file? And the defaults are hitting the wrong port on the server that doesn't support authentication.

Did you git pull from a release tag or master?
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 21, 2019, 01:57:09 AM
It sounds like roundcube is working properly and that log entry says that sendmail queued the message for delivery. I think you are going to have to keep tracing the message through the delivery process to find out where its gone. Perhaps the sendmail community can help you.

SMTP debug:

[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 220 *DOMAIN* ESMTP Postfix
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send: EHLO localhost
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-*DOMAIN*
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-PIPELINING
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-SIZE 10240000
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-VRFY
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-ETRN
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-STARTTLS
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-ENHANCEDSTATUSCODES
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250-8BITMIME
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250 DSN
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send: MAIL FROM:<admin@*DOMAIN*>
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250 2.1.0 Ok
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send: RCPT TO:<admin@*DOMAIN*>
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250 2.1.5 Ok
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send: DATA
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 354 End data with <CR><LF>.<CR><LF>
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send: MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Date: Thu, 21 Feb 2019 09:48:09 +0300
From: admin@*DOMAIN*
To: admin@*DOMAIN*
Subject: =?UTF-8?Q?=D1=84=D0=B0=D1=84?=
Message-ID: <59fe8aca337dfe66045682d73eda1cf3@*DOMAIN*>
X-Sender: admin@*DOMAIN*
User-Agent: Roundcube Webmail/1.3.8

test
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send:
.
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 250 2.0.0 Ok: queued as D459022B95E1
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Send: QUIT
[21-Feb-2019 09:48:09 +0300]: <8n0nfa0s> Recv: 221 2.0.0 Bye
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 21, 2019, 02:01:07 AM
Turn on debugging and check the Roundcube logs. Maybe you overwrote your config file? And the defaults are hitting the wrong port on the server that doesn't support authentication.

Port = 25 on all config files.

Quote
Did you git pull from a release tag or master?

I don't understand what you mean.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 22, 2019, 01:41:12 AM
I can't find the problem  :(
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 22, 2019, 03:10:20 AM
My postfix smtp config:

virtual_mailbox_base = /home/mail
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1024
virtual_uid_maps = static:1024
virtual_gid_maps = static:1024
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/spool/postfix/private/auth

smtpd_tls_cert_file = /etc/ssl/mail/public.pem
smtpd_tls_key_file = /etc/ssl/mail/private.key
smtpd_use_tls = yes
smtpd_tls_auth_only = yes


Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on February 25, 2019, 07:59:47 AM
I set follows this instruction https://www.dmosk.ru/instruktions.php?object=postfix-centos (https://www.dmosk.ru/instruktions.php?object=postfix-centos)
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: maximise on March 04, 2019, 02:34:11 AM
Any solutions ?
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: sathish on March 26, 2019, 06:51:52 AM
Why SMTP Error (220): Authentication failed?

Guys can u help me out about this problem too..!!
SMTP Error (220)

I am unable to send a mail from roundcube webmail but its working in outlook and Thunderbird mail clients.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on March 26, 2019, 02:40:33 PM
That message comes from your SMTP server. Check your Roundcube config to ensure you have the correct authentication settings for your setup and may be have a look at the SMTP logs to see if there is any more info about why it failed. Just as an example if Roundcube and your SMTP server are on the same machine some setups only require authentication on remote connections not local ones.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: PavelD on November 08, 2019, 02:31:52 AM
Its a roundcube strange behavior.
First scenario: we use default smtp_server and default smtp_port.
When SMTP server configured to force tls connection on submission its no offer AUTH (but it offers STARTTLS) before secure connection established, and roundcube just show 250 error (in logs we can see "SMTP Error: Authentication failure: SMTP server does not support authentication", which not true), instead of establish TLS connection before trying to authenticate.
 Connecting to localhost:587...
 Recv: 220 <host> ESMTP Postfix
 Send: EHLO <host>
 Recv: 250-<host>
 Recv: 250-PIPELINING
 Recv: 250-SIZE 73400320
 Recv: 250-ETRN
 Recv: 250-STARTTLS
 Recv: 250-ENHANCEDSTATUSCODES
 Recv: 250-8BITMIME
 Recv: 250 DSN
 Send: QUIT
 Recv: 221 2.0.0 Bye

Second scenario: we use smtp_server = tls://<host> and default smtp_port.
All the same, but roundcube establish tls connection and then just send QUIT and we see a 220 error message. In logs we can see "SMTP Error: Authentication failure: STARTTLS failed", but SMTP server says "Anonymous TLS connection established" and right next "lost connection afer STARTTLS".
 Connecting to tls://localhost:587...
 Recv: 220 <host> ESMTP Postfix
 Send: EHLO <host>
 Recv: 250-<host>
 Recv: 250-PIPELINING
 Recv: 250-SIZE 73400320
 Recv: 250-ETRN
 Recv: 250-STARTTLS
 Recv: 250-ENHANCEDSTATUSCODES
 Recv: 250-8BITMIME
 Recv: 250 DSN
 Send: STARTTLS
 Recv: 220 2.0.0 Ready to start TLS
 Send: QUIT
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: JohnDoh on November 08, 2019, 12:59:28 PM
have a look at this https://github.com/roundcube/roundcubemail/wiki/FAQ#problems-connecting-imapsmtp-server-via-ssltls because you are using `localhost` for your connection there is no way the cert is going to verify so you'll need to disable certificate verification.
Title: Re: Why SMTP Error (250): Authentication failed?
Post by: PavelD on November 11, 2019, 02:30:13 AM
Thanks for the info. Changing smtp_server to FQDN with valid certificate makes second scenario viable.