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:
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
2nd picture the only granted settings - but not using SSL/TLS !
3rd picture is a sample from Windows10 Mail-App with working settings.
@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
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.
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]
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]
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)
Stack trace:
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)
Stack trace:
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)
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): RainLoopActions->smtpSendMessage(Object(RainLoop\ModelAccount), Object(MailSo\Mime\Message), Resource id #45, 885, false, true)
535 5.7.8 Error: authentication failed: authentication failure\r\n
This is the problem, but I don't know why.
Thanks for helping.
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
@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
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
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 ?!
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
@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:
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
2.
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
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
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
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
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
Yeah, setting $__USE_SINGLE_LINE_AUTH_PLAIN_COMMAND to true fixed this issue for me connecting to a dovecot mail server, too. Thanks!
@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.
For me the problem was short login, I unselect and all solved....
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 !!!
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 ?
I have this problem recurring.

@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
@monzerfoda:
do you have Mail-Client (Rainloop) and Mail-Server (Dovecot) on same machine ?
setting is ?

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 !
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).
What did you changed exactly
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.
Most helpful comment
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
-> 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