Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

SMTP - "Authentification failed" #1629

Open
Chialya opened this issue Jan 24, 2018 · 22 comments
Open

SMTP - "Authentification failed" #1629

Chialya opened this issue Jan 24, 2018 · 22 comments

Comments

@Chialya
Copy link

Chialya commented Jan 24, 2018

RainLoop v1.11.3 App integrated in Nextcloud 12.0.4
System is running on Synology NAS using: Apache 2.4, PHP 7.0
Mail Server v1.6.4 from Synology on same machine (via localhost reachable)

I can't send mails, when SMTP-encryption (SSL/TLS) is used.
Error: Authentification failed
no matter what I choose:

  • SSL 465 or STARTTLS 587 or 25
  • localhost / IP / domain

only the way SMTP without encryption and without authentication works !

"other mail-clients" on the same machine (connect via localhost),
or apps on mobilephone (connect via domain) ect,
with the same login-data, works fine !!

the challenge is, that the mail-server request a username, not mail-address !
so I select the option: "use short usernames"

using IMAP with SSL and sending mails without SSL works also fine with my settings.
I think there is a problem with "use short username" on SMTP
so the mail-server doesn't get the correct login for authentication.

so please help me
thanks :)


1st picture shows the error message when SSL is enabled

fehlgeschl

2nd picture the only granted settings - but not using SSL/TLS !

io

3rd picture is a sample from Windows10 Mail-App with working settings.

vergleich

@djdill
Copy link

djdill commented Jan 29, 2018

@Chialya some logs would be good to get the problem resolved:

Enable logging by editing this file:

/usr/local/lib/rainloop/data/data/default/configs/application.ini
[logs]
; Enable logging
enable = on < change this from off to on

Logging will start, replicate the issue and attach the logs here
Feel free to turn logging off after you have a log file

Also if you can get a copy of your tail /var/log/mail.log or smtp server logs

Feel free to strip them of IPs and usernames

@Chialya
Copy link
Author

Chialya commented Jan 29, 2018

Hi djdill, thank you for you answer.

I've searched the log bevore, but there is nothing I can do with it (no cause).
The korrekt URL to config under a nextcloud setup is:
..\nextcloud\data\rainloop-storage_data__default_\configs\application.ini
There I've setup: [logs] enable = On and hide_passwords = Off for testing.

[Bild1] Here is the current setting.

io2

I guarantee that this setting will work for other programs!
But the other programms are not on the same machine (like mail-server and nextcloud-rainloop).

So only rainloop can reach the mail-server over localhost.
BUT: the SSL-certificate only contains the domain (not localhost)!
So i've tried "lokalhost" also the domain "smtp.XXXXX.de", but same result for both.

Interesting is, that ssl://127.0.0.1:993 is working, although the certificate does not contain 127.0.0.1.

[Bild2]

fehlgeschl1

In the log i've stripped domain wih XXXXX, username with AAAAAAAAAA and password with BBBBBBBBBB.
-> In all cases the vaules of username and password in the log was correkt!

[12:29:47.567][70f77b35] INFO[DATA]: [DATE:29.01.18][OFFSET:-00][RL:1.11.3][PHP:7.0.24][IP:192.168.0.5][PID:26133][Apache/2.4.29 (Unix)][fpm-fcgi]
[12:29:47.567][70f77b35] INFO[DATA]: [Suhosin:off][APC:off][MB:on][PDO:dblib,mysql,pgsql,sqlite][cloud:true][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2]
[12:29:47.568][70f77b35] REQUEST[NOTE]: [POST] https://cloud.local/index.php/apps/rainloop/app/?/Ajax/&q[]=/_og6lTEmbCP11FJRY-isRLr9tWg4nQa06llJL9DDycfP8voov4WnEbtbqXjIS-iM11ETdhGDUInjwidCbjS48yjDJRhjZQ-GOtkmKj-qz1w4YRfpHxZewWcp1AsSNbxQyFLJwS3FI3ZWLlFcrxLn0QMtRCnQtcyaZk16JjNV8jOiufT5vZBtDopluzbIZiVkjjB09jcihoQ3GpRI5UayzFD4_Bp2eZuTeLAU8LuM-OV8gupUnzPZPrXGM2b6qNHv-0FOj510_nJMMLl72eVssa4NkH3gVZe3ZdcrXFv1bxcg9IDrrBSvZCSkjdR8p4IdivEhfyYsQlYVCKEugRZUpGEI2Jdg/
[12:29:47.569][70f77b35] AJAX[NOTE]: Action: DoSendMessage
[12:29:47.569][70f77b35] POST[DATA]: {"IdentityID":"2jn8dxf92tw2vr5p7jksr0snj6cy8337","MessageFolder":"Drafts","MessageUid":"137","SentFolder":"Sent","To":"[email protected]","Cc":"","Bcc":"","ReplyTo":"","Subject":"test","TextIsHtml":"1","Text":"<div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;"><br /><br /></signature></div>","DraftInfo":"","InReplyTo":"","References":"","Dsn":"0","ReadReceiptRequest":"0","MarkAsImportant":"0","Action":"SendMessage","XToken":"6ee44043250bfc2ae4c3d9dd3f1d452c"}
[12:29:47.573][70f77b35] IMAP[NOTE]: Start connection to "ssl://127.0.0.1:993"
[12:29:47.604][70f77b35] IMAP[NOTE]: Connected (success)
[12:29:47.639][70f77b35] IMAP[DATA]: < * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.\r\n
[12:29:47.640][70f77b35] IMAP[DATA]: > TAG1 AUTHENTICATE PLAIN\r\n
[12:29:47.641][70f77b35] IMAP[DATA]: < + \r\n
[12:29:47.641][70f77b35] IMAP[DATA]: > bmVvbmdhemV0cG9yYTVBNGUzRDZnOFY=\r\n
[12:29:47.779][70f77b35] IMAP[DATA]: < TAG1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE] Logged in\r\n
[12:29:47.787][70f77b35] SMTP[NOTE]: Start connection to "tcp://smtp.XXXXX.de:25"
[12:29:47.791][70f77b35] SMTP[NOTE]: Connected (success)
[12:29:47.873][70f77b35] SMTP[DATA]: < 220 XXXXX.de ESMTP Postfix\r\n
[12:29:47.874][70f77b35] SMTP[DATA]: > EHLO cloud.local\r\n
[12:29:47.875][70f77b35] SMTP[DATA]: < 250-XXXXX.de\r\n
[12:29:47.875][70f77b35] SMTP[DATA]: < 250-PIPELINING\r\n
[12:29:47.875][70f77b35] SMTP[DATA]: < 250-SIZE 52428800\r\n
[12:29:47.875][70f77b35] SMTP[DATA]: < 250-ETRN\r\n
[12:29:47.875][70f77b35] SMTP[DATA]: < 250-STARTTLS\r\n
[12:29:47.876][70f77b35] SMTP[DATA]: < 250-AUTH PLAIN LOGIN\r\n
[12:29:47.876][70f77b35] SMTP[DATA]: < 250-AUTH=PLAIN LOGIN\r\n
[12:29:47.876][70f77b35] SMTP[DATA]: < 250-ENHANCEDSTATUSCODES\r\n
[12:29:47.876][70f77b35] SMTP[DATA]: < 250-8BITMIME\r\n
[12:29:47.876][70f77b35] SMTP[DATA]: < 250 DSN\r\n
[12:29:47.877][70f77b35] SMTP[DATA]: > STARTTLS\r\n
[12:29:47.877][70f77b35] SMTP[DATA]: < 220 2.0.0 Ready to start TLS\r\n
[12:29:47.911][70f77b35] SMTP[DATA]: > EHLO cloud.local\r\n
[12:29:47.912][70f77b35] SMTP[DATA]: < 250-XXXXX.de\r\n
[12:29:47.912][70f77b35] SMTP[DATA]: < 250-PIPELINING\r\n
[12:29:47.912][70f77b35] SMTP[DATA]: < 250-SIZE 52428800\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: < 250-ETRN\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: < 250-AUTH PLAIN LOGIN\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: < 250-AUTH=PLAIN LOGIN\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: < 250-ENHANCEDSTATUSCODES\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: < 250-8BITMIME\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: < 250 DSN\r\n
[12:29:47.913][70f77b35] SMTP[DATA]: > AUTH PLAIN\r\n
[12:29:47.914][70f77b35] SMTP[DATA]: < 334 \r\n
[12:29:47.914][70f77b35] SMTP[DATA]: > bmVvbmdhemV0cG9yYTVBNGUzRDZnOFY=\r\n
[12:29:51.681][70f77b35] SMTP[DATA]: < 535 5.7.8 Error: authentication failed: authentication failure\r\n
[12:29:51.686][70f77b35] SMTP[ERROR]: MailSo\Smtp\Exceptions\NegativeResponseException: 535 5.7.8 Error: authentication failed: authentication failure in /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php:789
Stack trace:
#0 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php(670): MailSo\Smtp\SmtpClient->validateResponse(Array)
#1 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php(268): MailSo\Smtp\SmtpClient->sendRequestWithCheck('bmVvbmdhemV0cG9...', 235, '', true)
#2 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Model/Account.php(521): MailSo\Smtp\SmtpClient->Login('AAAAAAAAAA', 'BBBBBBBBBB', true, false)
#3 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6219): RainLoop\Model\Account->OutConnectAndLoginHelper(Object(RainLoop\Plugins\Manager), Object(MailSo\Smtp\SmtpClient), Object(RainLoop\Config\Application), false)
#4 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6377): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\Account), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
#5 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoSendMessage()
#6 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#7 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#8 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#9 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/handle.php(94): RainLoop\Service::Handle()
#10 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/include.php(228): include('/volume1/web/ne...')
#11 /volume1/web/nextcloud12/apps/rainloop/app/index.php(13): include('/volume1/web/ne...')
#12 /volume1/web/nextcloud12/apps/rainloop/app.php(49): include('/volume1/web/ne...')
#13 /volume1/web/nextcloud12/lib/private/Route/Route.php(155) : runtime-created function(1): require_once('/volume1/web/ne...')
#14 [internal function]: __lambda_func(NULL)
#15 /volume1/web/nextcloud12/lib/private/Route/Router.php(299): call_user_func('\x00lambda_526', Array)
#16 /volume1/web/nextcloud12/lib/base.php(1004): OC\Route\Router->match('/apps/rainloop/...')
#17 /volume1/web/nextcloud12/index.php(48): OC::handleRequest()
#18 {main}
[12:29:51.689][70f77b35] SMTP[NOTICE]: MailSo\Smtp\Exceptions\NegativeResponseException: 535 5.7.8 Error: authentication failed: authentication failure in /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php:789
Stack trace:
#0 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php(670): MailSo\Smtp\SmtpClient->validateResponse(Array)
#1 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php(268): MailSo\Smtp\SmtpClient->sendRequestWithCheck('bmVvbmdhemV0cG9...', 235, '', true)
#2 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Model/Account.php(521): MailSo\Smtp\SmtpClient->Login('AAAAAAAAAA', 'BBBBBBBBBB', true, false)
#3 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6219): RainLoop\Model\Account->OutConnectAndLoginHelper(Object(RainLoop\Plugins\Manager), Object(MailSo\Smtp\SmtpClient), Object(RainLoop\Config\Application), false)
#4 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6377): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\Account), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
#5 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoSendMessage()
#6 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#7 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#8 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#9 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/handle.php(94): RainLoop\Service::Handle()
#10 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/include.php(228): include('/volume1/web/ne...')
#11 /volume1/web/nextcloud12/apps/rainloop/app/index.php(13): include('/volume1/web/ne...')
#12 /volume1/web/nextcloud12/apps/rainloop/app.php(49): include('/volume1/web/ne...')
#13 /volume1/web/nextcloud12/lib/private/Route/Route.php(155) : runtime-created function(1): require_once('/volume1/web/ne...')
#14 [internal function]: __lambda_func(NULL)
#15 /volume1/web/nextcloud12/lib/private/Route/Router.php(299): call_user_func('\x00lambda_526', Array)
#16 /volume1/web/nextcloud12/lib/base.php(1004): OC\Route\Router->match('/apps/rainloop/...')
#17 /volume1/web/nextcloud12/index.php(48): OC::handleRequest()
#18 {main}

Next MailSo\Smtp\Exceptions\LoginBadCredentialsException: 535 5.7.8 Error: authentication failed: authentication failure in /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php:273
Stack trace:
#0 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Model/Account.php(521): MailSo\Smtp\SmtpClient->Login('AAAAAAAAAA', 'BBBBBBBBBB', true, false)
#1 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6219): RainLoop\Model\Account->OutConnectAndLoginHelper(Object(RainLoop\Plugins\Manager), Object(MailSo\Smtp\SmtpClient), Object(RainLoop\Config\Application), false)
#2 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6377): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\Account), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
#3 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoSendMessage()
#4 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#5 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#6 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#7 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/handle.php(94): RainLoop\Service::Handle()
#8 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/include.php(228): include('/volume1/web/ne...')
#9 /volume1/web/nextcloud12/apps/rainloop/app/index.php(13): include('/volume1/web/ne...')
#10 /volume1/web/nextcloud12/apps/rainloop/app.php(49): include('/volume1/web/ne...')
#11 /volume1/web/nextcloud12/lib/private/Route/Route.php(155) : runtime-created function(1): require_once('/volume1/web/ne...')
#12 [internal function]: __lambda_func(NULL)
#13 /volume1/web/nextcloud12/lib/private/Route/Router.php(299): call_user_func('\x00lambda_526', Array)
#14 /volume1/web/nextcloud12/lib/base.php(1004): OC\Route\Router->match('/apps/rainloop/...')
#15 /volume1/web/nextcloud12/index.php(48): OC::handleRequest()
#16 {main}
[12:29:51.690][70f77b35] INFO[ERROR]: MailSo\Smtp\Exceptions\NegativeResponseException: 535 5.7.8 Error: authentication failed: authentication failure in /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php:789
Stack trace:
#0 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php(670): MailSo\Smtp\SmtpClient->validateResponse(Array)
#1 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php(268): MailSo\Smtp\SmtpClient->sendRequestWithCheck('bmVvbmdhemV0cG9...', 235, '', true)
#2 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Model/Account.php(521): MailSo\Smtp\SmtpClient->Login('AAAAAAAAAA', 'BBBBBBBBBB', true, false)
#3 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6219): RainLoop\Model\Account->OutConnectAndLoginHelper(Object(RainLoop\Plugins\Manager), Object(MailSo\Smtp\SmtpClient), Object(RainLoop\Config\Application), false)
#4 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6377): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\Account), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
#5 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoSendMessage()
#6 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#7 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#8 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#9 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/handle.php(94): RainLoop\Service::Handle()
#10 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/include.php(228): include('/volume1/web/ne...')
#11 /volume1/web/nextcloud12/apps/rainloop/app/index.php(13): include('/volume1/web/ne...')
#12 /volume1/web/nextcloud12/apps/rainloop/app.php(49): include('/volume1/web/ne...')
#13 /volume1/web/nextcloud12/lib/private/Route/Route.php(155) : runtime-created function(1): require_once('/volume1/web/ne...')
#14 [internal function]: __lambda_func(NULL)
#15 /volume1/web/nextcloud12/lib/private/Route/Router.php(299): call_user_func('\x00lambda_526', Array)
#16 /volume1/web/nextcloud12/lib/base.php(1004): OC\Route\Router->match('/apps/rainloop/...')
#17 /volume1/web/nextcloud12/index.php(48): OC::handleRequest()
#18 {main}

Next MailSo\Smtp\Exceptions\LoginBadCredentialsException: 535 5.7.8 Error: authentication failed: authentication failure in /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/MailSo/Smtp/SmtpClient.php:273
Stack trace:
#0 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Model/Account.php(521): MailSo\Smtp\SmtpClient->Login('AAAAAAAAAA', 'BBBBBBBBBB', true, false)
#1 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6219): RainLoop\Model\Account->OutConnectAndLoginHelper(Object(RainLoop\Plugins\Manager), Object(MailSo\Smtp\SmtpClient), Object(RainLoop\Config\Application), false)
#2 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6377): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\Account), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
#3 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoSendMessage()
#4 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#5 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#6 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#7 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/handle.php(94): RainLoop\Service::Handle()
#8 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/include.php(228): include('/volume1/web/ne...')
#9 /volume1/web/nextcloud12/apps/rainloop/app/index.php(13): include('/volume1/web/ne...')
#10 /volume1/web/nextcloud12/apps/rainloop/app.php(49): include('/volume1/web/ne...')
#11 /volume1/web/nextcloud12/lib/private/Route/Route.php(155) : runtime-created function(1): require_once('/volume1/web/ne...')
#12 [internal function]: __lambda_func(NULL)
#13 /volume1/web/nextcloud12/lib/private/Route/Router.php(299): call_user_func('\x00lambda_526', Array)
#14 /volume1/web/nextcloud12/lib/base.php(1004): OC\Route\Router->match('/apps/rainloop/...')
#15 /volume1/web/nextcloud12/index.php(48): OC::handleRequest()
#16 {main}

Next RainLoop\Exceptions\ClientException: AuthError[102] in /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php:6318
Stack trace:
#0 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Actions.php(6377): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\Account), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
#1 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoSendMessage()
#2 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#3 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#4 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#5 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/app/handle.php(94): RainLoop\Service::Handle()
#6 /volume1/web/nextcloud12/apps/rainloop/app/rainloop/v/1.11.3/include.php(228): include('/volume1/web/ne...')
#7 /volume1/web/nextcloud12/apps/rainloop/app/index.php(13): include('/volume1/web/ne...')
#8 /volume1/web/nextcloud12/apps/rainloop/app.php(49): include('/volume1/web/ne...')
#9 /volume1/web/nextcloud12/lib/private/Route/Route.php(155) : runtime-created function(1): require_once('/volume1/web/ne...')
#10 [internal function]: __lambda_func(NULL)
#11 /volume1/web/nextcloud12/lib/private/Route/Router.php(299): call_user_func('\x00lambda_526', Array)
#12 /volume1/web/nextcloud12/lib/base.php(1004): OC\Route\Router->match('/apps/rainloop/...')
#13 /volume1/web/nextcloud12/index.php(48): OC::handleRequest()
#14 {main}
[12:29:51.691][70f77b35] AJAX[DATA]: {"Action":"SendMessage","Result":false,"ErrorCode":102,"ErrorMessage":"","ErrorMessageAdditional":"","Time":4139}
[12:29:51.691][70f77b35] SMTP[DATA]: > QUIT\r\n
[12:29:51.692][70f77b35] SMTP[DATA]: < 221 2.0.0 Bye\r\n
[12:29:51.694][70f77b35] SMTP[NOTE]: Disconnected from "tcp://smtp.XXXXX.de:25" (success)
[12:29:51.699][70f77b35] IMAP[DATA]: > TAG2 LOGOUT\r\n
[12:29:51.699][70f77b35] IMAP[DATA]: < * BYE Logging out\r\n
[12:29:51.700][70f77b35] IMAP[DATA]: < TAG2 OK Logout completed.\r\n
[12:29:51.701][70f77b35] IMAP[NOTE]: Disconnected from "ssl://127.0.0.1:993" (success)
[12:29:51.701][70f77b35] INFO[MEMORY]: Memory peak usage: 2MB
[12:29:51.702][70f77b35] INFO[TIME]: Time delta: 4.1500458717346

535 5.7.8 Error: authentication failed: authentication failure\r\n
This is the problem, but I don't know why.

Thanks for helping.

@Chialya
Copy link
Author

Chialya commented Jan 29, 2018

smtp_use_auth_plain = On
smtp_use_auth_cram_md5 = Off

everything seems to be correct

but what is this ?:

[12:29:47.913][70f77b35] SMTP[DATA]: > AUTH PLAIN\r\n
[12:29:47.914][70f77b35] SMTP[DATA]: < 334 \r\n
[12:29:47.914][70f77b35] SMTP[DATA]: > bmVvbmdhemV0cG9yYTVBNGUzRDZnOFY=\r\n

@djdill
Copy link

djdill commented Jan 30, 2018

@Chialya

First thing you need to delete your comments above (the logs)
You have listed your password for your server in hash what is very easy to show. SO PLEASE delete everything above with the lines starting: AGJ
Then change your password on IMAP and SMTP

Second thing,
It appears that short auth is being sent to the server but the smtp server doesn't understand how it works. (have a look below at the link) decode your password block and see what I mean, it doesn't work. There appears to be a bug in short auth base64 package for rainloop, as its not sending the password / username correctly with \000

Also one thing you can try is test to see if you can connect to the smtp server on cli via the host:
Using the following:
(this guide)
https://qmail.jms1.net/test-auth.shtml

openssl s_client -debug -starttls smtp -crlf -connect localhost:587
AUTH PLAIN (see above link)

You can test it using your password (after you change it) and username
If you don't get 235 2.7.0 Authentication successful then something is wrong with smtp server handing

@djdill
Copy link

djdill commented Jan 30, 2018

Best recommendation to get this fixed is to move to another smtp server on the same box that supports auth using email address.

you can run that side by side on another port if you don't want to remove your current server
Also please update to rainloop current = "1.11.3" .. this bug might be fixed

@Chialya
Copy link
Author

Chialya commented Jan 30, 2018

Hi Djdill,
I'm understanding only 70% of your Post.. :-)
I've changed the passwords.

Trying an other mail-server ist not possible for me. That's technically very difficult!
Actually I like the way, not to use the email address for login.
Thus I have an additional security because email ≠ loginname.
So when its possible that rainloop can work with it, it will be perfekt for me!

Nextcloud Apps -> Version 5.0.6 (https://apps.nextcloud.com/apps/rainloop)
In Rainloop-Adminpanel is Version 1.11.3 installed !
There is no Update ?!

@djdill
Copy link

djdill commented Jan 30, 2018

Good to see you have changed passwords, the way that SMTP works is it encodes the username / passwords in the PLAIN AUTH part, so both where readable.

I am going to see if I can replicate your issue later and will post back if I can confirm this bug.

In Rainloop-Adminpanel is Version 1.11.3

That is good, your log files show that too, I don't know why I was thinking you are on 1.11.2

@djdill
Copy link

djdill commented Jan 31, 2018

@Chialya

So your rainloop install is broken -

I have run testing,
new Ubuntu 14.04 box, fresh nextcloud install fresh, rainloop app
; after running up a new nextcloud install and installing rainloop with logs
Then I enabled short usernames

Checked the logs and found the line:
[12:29:47.913][70f77b35] SMTP[DATA]: > AUTH PLAIN\r\n
[12:29:47.914][70f77b35] SMTP[DATA]: < 334 \r\n
[12:29:47.914][70f77b35] SMTP[DATA]: < U2hvcnRVc2VyTmFtZQBQYXNzd29yZA==\r\n

The BASE64 encoded text above will be like this in plain text: \000ShortUserName\000Password
What will = U2hvcnRVc2VyTmFtZQBQYXNzd29yZA==

Have a look here: https://www.base64decode.org/

Have a look at your logs again.. Try to auth (Fail) and then copy the
The BASE64 code and see what it out puts, I think you will find what I saw yesterday is that rainloop is not encoding your short login name / password correctly. This is likely because of some error in the nextcloud install of rainloop a few months ago?

Anyway two options:
1.
Upgrade your version of nextcloud - make sure you are running the latest
I used : https://download.nextcloud.com/server/prereleases/nextcloud-13.0.0RC3.zip

Remove rainloop from next cloud, then go to the data folder on the nextcloud install and delete the rainloop-data folder all together
Then try reinstalling rainlopp app from the nextcloud add in
Setup again and test

Create a new rainloop install outside of nextcloud by following this guide:
http://www.rainloop.net/docs/installation/

Depending on your web server www localtion:

mkdir /var/www/html/rainloop
cd /var/www/html/rainloop
curl -sL https://repository.rainloop.net/installer.php | php

Then

http://webmail.domain.com/?admin
Default login is "admin", password is "12345".

Setup again and test - let me know

@MrNterra
Copy link

MrNterra commented Oct 9, 2019

Hello, it's almost the end of 2019 and it seems like this issue is still alive... at least kind off.
I'm having the same issues and tried the above mentioned approaches to solve my problem, but it didn't work.

Testing the smtp and imap server works without any issue, logging in too. The problem is that if I try to send a Mail, I get the "authentification failed" warning as visible in the above post.

I'm running RainLoop in Nextcloud 17 and even tried a drect install on my QNAP NAS showing the same problems.
I even base64 decoded the authentification data and everything seems to be in order. I'm really at the end of my wits here... Maybe someone is able to find out whats causing this.

Thanks in advance!
Terra

log-2019-10-09.txt

@Chialya
Copy link
Author

Chialya commented Oct 10, 2019

Hello Terra,
I found a solution for myself.

While studying the connection-logs from nextcloud, I read out the detailed logs from my SMTP-Server too. So I set it to log-mode=5. But Attention /!\ There are more than 1000 lines in the log with only 1 connection attempt! I testet other clients like MS-Outlook and K9-Mail on phone, which worked great. I read out thousand of thousand lines in the logs. And in the depths of the records I found the reason why the SMTP-Server refused the connection. It was because the Base64 token had to contain the username and password both in 1 line! Rainloop tried to connect a 2-line authentication, and this was rejected by my SMTP-Server. I took the Rainloop-App apart and searched for the connection method - line by line! As I wanted to rewrite it, I found a simple switch:

I have edited the file:
web/nextcloud/apps/rainloop/app/rainloop/v/{VERSION}/app/libraries/MailSo/Smtp/SmtpClient.php

  • public $__USE_SINGLE_LINE_AUTH_PLAIN_COMMAND = false;
    -> change "false" into "true".

Then it works on my Synology NAS (probably also on your QNAP).
But you have to change it every time you update the Rainloop-App! Don't forget this.

I've done thousands of lines in the logs, several lines of source code and many experiments to work on the problem. So hope it helps you as well.

Good luck
Chia

@MrNterra
Copy link

Hey Chiala,
I bow before you in deep respect! This absolutely solved my issue.
Now RainLoop works like a dream! Thank you so much!

Terra

@Alyoscha
Copy link

Yeah, setting $__USE_SINGLE_LINE_AUTH_PLAIN_COMMAND to true fixed this issue for me connecting to a dovecot mail server, too. Thanks!

@Chialya
Copy link
Author

Chialya commented Dec 30, 2019

@djdill
Is it possible to add an option like a switch in the admin panel, to simply change the function without manipulating the source code?
Surely there are still several users who have the problem, but all of them will not report here.

@sopedro
Copy link

sopedro commented Jan 3, 2020

For me the problem was short login, I unselect and all solved....

@neiliob19731
Copy link

Adding my $0.02....

This was an issue for me, as well. I could get data from an email server, but could not send from my Nextcloud snap v19.0.2 with Rainloop 1.1.14
The above suggestion fixed it:
edit the file:
(the path in the snap is slightly different)
/var/snap/nextcloud/current/nextcloud/extra-apps/rainloop/app/rainloop/v/1.14.0/app/libraries/MailSo/Smtp/SmtpClient.php

public $__USE_SINGLE_LINE_AUTH_PLAIN_COMMAND = false;
-> change "false" into "true".

Thnx for posting, @Chialya !!!

@vtolenti89
Copy link

I am also facing thre same problem but the above solution did not work for me. Anything else I should try?

@Chialya Where did you set the log level ?

@monzerfoda
Copy link

I have this problem recurring.

image

@Chialya
Copy link
Author

Chialya commented Dec 12, 2020

@vtolenti89:
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html

and

(Mail-Server)/target/etc/main.cf

smtpd_tls_loglevel = 5

@Chialya
Copy link
Author

Chialya commented Dec 12, 2020

@monzerfoda:
do you have Mail-Client (Rainloop) and Mail-Server (Dovecot) on same machine ?

setting is ?

image

First try modify:

(nextcloud)/apps/rainloop/app/rainloop/v/{VERSION}/app/libraries/MailSo/Smtp/SmtpClient.php

public $__USE_SINGLE_LINE_AUTH_PLAIN_COMMAND = true;

OR try verify:

(Dovecot-Mailserver)/target/etc/dovecot/conf.d/10-auth.conf

auth_mechanisms = plain login

"auth_mechanisms" must be "plain" for 1-line and "login" for 2-line authentication to accept both.

Rainloop uses 2-line authentication by default !

@supersirius814
Copy link

I debugged the code and found the error.
My mail server includes the domain in the user ID (eg [email protected]).
However, rainloop automatically deleted the domain part when logging in.
Because of this, the identification information became wrong.

Accurate login information
user: [email protected]
pass: password

Login information attempted by rainloop
user: admin
pass: password

I fixed the error by modifying file(rainloop/v*/app/libraries/RainLoop/Model/Account.php).

@sagarmohanty2k00
Copy link

What did you changed exactly

@Chialya
Copy link
Author

Chialya commented Apr 19, 2021

There is no "error"!
You can change between long and short user-name in the rainloop-admin-panel.
That is not the problem at issue here.

yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this issue Nov 11, 2021
While I'm here,

* Switch to DISTVERSION
* Pet portclippy
* Re-format Makefile with portfmt

Reference:	RainLoop/rainloop-webmail#1629
PR:		257017
Reported by:	pi
Obtained from:	RainLoop/rainloop-webmail#1629 (comment)
MFH:		2021Q4
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this issue Nov 11, 2021
While I'm here,

* Switch to DISTVERSION
* Pet portclippy
* Re-format Makefile with portfmt

Reference:	RainLoop/rainloop-webmail#1629
PR:		257017
Reported by:	pi
Obtained from:	RainLoop/rainloop-webmail#1629 (comment)
MFH:		2021Q4
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this issue Nov 11, 2021
While I'm here,

* Switch to DISTVERSION
* Pet portclippy
* Re-format Makefile with portfmt

Reference:	RainLoop/rainloop-webmail#1629
PR:		257017
Reported by:	pi
Obtained from:	RainLoop/rainloop-webmail#1629 (comment)
MFH:		2021Q4
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this issue Nov 11, 2021
While I'm here,

* Switch to DISTVERSION
* Pet portclippy
* Re-format Makefile with portfmt

Reference:	RainLoop/rainloop-webmail#1629
PR:		257017
Reported by:	pi
Obtained from:	RainLoop/rainloop-webmail#1629 (comment)
MFH:		2021Q4
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Nov 11, 2021
While I'm here,

* Switch to DISTVERSION
* Pet portclippy
* Re-format Makefile with portfmt

Reference:	RainLoop/rainloop-webmail#1629
PR:		257017
Reported by:	pi
Obtained from:	RainLoop/rainloop-webmail#1629 (comment)
MFH:		2021Q4
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Nov 11, 2021
While I'm here,

* Switch to DISTVERSION
* Pet portclippy
* Re-format Makefile with portfmt

Reference:	RainLoop/rainloop-webmail#1629
PR:		257017
Reported by:	pi
Obtained from:	RainLoop/rainloop-webmail#1629 (comment)
MFH:		2021Q4

(cherry picked from commit 09c2f9d)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants