mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
LetreErr when sending test mail #657
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maeries on GitHub (Mar 24, 2020).
I want to setup bitwarden to be able to send mails. For the mail service i would like to use gmail (or does bitwarden come with its own?)

This is my (alienated) configuration:
Now, when I try to send a test mail I get a popup saying: Error sending SMTP test email LetreErr
The shell says:
bitwarden_1 | [2020-03-23 22:22:17][request][INFO] POST /admin/test/smtp/bitwarden_1 | [2020-03-23 22:22:27][error][ERROR] LetreErr.bitwarden_1 | [CAUSE] Parsing(bitwarden_1 | Tag,bitwarden_1 | )bitwarden_1 | [2020-03-23 22:22:27][response][INFO] POST /admin/test/smtp (test_smtp) => 400 Bad RequestI can't find any logfile though.
I tried it with and without explicit TLS and also with the ports 465 and 587.
I run bitwarden 1.14.1-91dd1947 using docker-compose on a ubuntu LXC.
@jjlin commented on GitHub (Mar 24, 2020):
Try it with
Enable SSLchecked,Use explicit TLSunchecked, and port 587. Also, if you have 2FA enabled on your Google account, you need to use an app password instead of your normal Google password (see https://support.google.com/mail/answer/185833).@tnds82 commented on GitHub (Mar 24, 2020):
The same problem here.
Configuration was performed with Enable SSL checked, Use explicit TLS unchecked, and port 587
I tested with two different gmail accounts one with 2FA and one without 2FA.
I created the application password and it continues to give the same error
@maeries commented on GitHub (Mar 24, 2020):
With explicit TLS and Port 587 I get the same message. The difference is that it now appears instantly instead of being delayed 10s. I actually used a stop watch, so I'm sure it's not the 15s timeout that caused it before.
The account I'm using does not have 2FA
@jjlin commented on GitHub (Mar 24, 2020):
It works for me with the latest Docker image and the configuration I mentioned (I use 2FA). Perhaps your network provider blocks port 587? Try
telnet smtp.gmail.com 587and see if you get a response like220 smtp.gmail.com ESMTP k20sm783595pgn.62 - gsmtp.@maeries commented on GitHub (Mar 25, 2020):
The port isn't blocked. I get the response you mentioned
@VolkanoLiu commented on GitHub (Mar 28, 2020):
Maybe you can
apt install libperl5.28in the container. I solved this problem by the method. I found this problem when I try another Perl script.@maeries commented on GitHub (Mar 28, 2020):
I can't get that to work unfortunately
root@f83766827d96:/# apt install libperl5.28Reading package lists... DoneBuilding dependency treeReading state information... DoneE: Unable to locate package libperl5.28E: Couldn't find any package by glob 'libperl5.28'E: Couldn't find any package by regex 'libperl5.28'@VolkanoLiu commented on GitHub (Mar 28, 2020):
You should firstly
apt update.The libperl version is not always the same, so you can use
apt search libperl5to find the proper version and then install it.By the way, if the container's MTU is not right, the update will be very slow.
Edit: install libperl cannot solve the problem, just change the MTU.
@jjlin commented on GitHub (Mar 28, 2020):
I highly doubt perl has anything to do with this, given bitwarden_rs doesn't call out to perl to send mail. However, you might try using something like https://github.com/mludvig/smtp-cli from within your bitwarden_rs container to see if you can gain any insight into what's going wrong. Note that you will need perl and various modules in the container for this tool; see its README.md for details.
@VolkanoLiu commented on GitHub (Mar 28, 2020):
Yes, I'm sorry I made a mistake.
I think the wrong MTU is the real reason.
I remove the libperl and the SMTP works fine. But when I reset the MTU to the default value (1500), the LetreErr happens again. It's better to set the MTU the same as physical network adapter.
I change the MTU and install libperl at the same time, so I made the mistake.
To change the MTU, this is a way:
@maeries commented on GitHub (Mar 28, 2020):
I guess I have to put that in the docker-compose.yml, right?
But what do I set the MTU to? Both the ubuntu LXC container and Proxmox show an MTU of 1500 using
ip aand alsoapt updatein the docker container seemed to be at normal speed. So I guess 1500 is correct@maeries commented on GitHub (Apr 1, 2020):
As the guy in #943, I also used a gmail accont with a custom domain, but unlike them I couldn't solve it by using another account. I tried a different google account and one from a different provider. The error is still the same
Edit: I just noticed that this time I got a different output in the console. I also got this one when I first encountered this problem, but I have no idea why I got the one from my first post temporarily.
@jjlin commented on GitHub (Apr 1, 2020):
Did you click the save button to save your settings before testing each configuration? Otherwise the send test email functionality won't pick up on the changes.
@maeries commented on GitHub (Apr 2, 2020):
Yes, i did
@kassyss commented on GitHub (Apr 2, 2020):
Hello,
Until today i was using smtp with port 25 (and no authentication) but because i wanted to be "more secure" i have played with Bitwarden_rs environment file to setup mail with my own selfhosted mailserver using port 587.
The following configuration is not working
The following configuration is working
So i conclude that there is a problem if SMTP_FROM differs from SMTP_USERNAME
(My mail server allow to change the MAIL FROM)
Hope this can help.
Best regards,
@maeries commented on GitHub (Apr 5, 2020):
unfortunately I already had set SMTP_FROM and SMTP_USERNAME to the same value, so that is not the reason for this issue
@yzhblind commented on GitHub (Apr 5, 2020):
I got the problem in a different way.
When I tried to send a test mail, I also got "Error sending SMTP test email LetreErr".
[2020-04-05 11:53:19][start][INFO] Rocket has launched from http://0.0.0.0:80[2020-04-05 12:00:25][request][INFO] GET /admin/[2020-04-05 12:00:25][response][INFO] GET /admin (admin_page) => 200 OK[2020-04-05 12:00:39][request][INFO] POST /admin/test/smtp/[2020-04-05 12:01:09][error][ERROR] LetreErr.[CAUSE] Io(Os {code: 11,kind: WouldBlock,message: "Resource temporarily unavailable",},)[2020-04-05 12:01:09][response][INFO] POST /admin/test/smtp (test_smtp) => 400 Bad Request@kassyss commented on GitHub (Apr 5, 2020):
Have you tried to test connectivity and dns resolution (smtp gmail) From the Bitwarden_rs container itself (docker exec -it container-name sh)?
@maeries commented on GitHub (Apr 6, 2020):
looks fine
Edit:
interestingly I get another result if I run the command on my desktop PC
Edit2:
I set the DNS server of the container to 1.1.1.1 an now I get the same result as on my PC. Does not change anything regarding the problem though
@jonathanmmm commented on GitHub (Apr 9, 2020):
Same here, have change nothing and suddenly it does not work anymore.
I get the same error on the webinterface but different in log:
[2020-04-09 08:12:03][request][INFO] POST /admin/test/smtp/
[2020-04-09 08:12:19][error][ERROR] LetreErr.
[CAUSE] Io(
Custom {
kind: TimedOut,
error: "connection timed out",
},
)
[2020-04-09 08:12:19][response][INFO] POST /admin/test/smtp (test_smtp) => 400 Bad Request
I run the bitwardenrs/server:raspberry docker on Rasbian stretch.
Strangely I couldn't change settings and send a test email through logging in through my nginx proxy. Also there were no profile icons for the user, I believe. I have connected directly with the rocket port that goes out of docker. There it works (means I can change settings and request to send test email, but it fails, as the error log shows).
@maeries commented on GitHub (Apr 20, 2020):
UPDATE: I upgraded to 1.14.2-5a390a97, but the error still occurs
@jjlin commented on GitHub (Apr 20, 2020):
Nothing has changed in the email sending code recently, so I wouldn't expect an upgrade to make a difference. Did you try my suggestion of seeing if you can get it work using another tool like
smtp-cli?Also, unless you're dead set on using Gmail for some reason, you might try something like SendGrid or MailJet instead. These all offer 100-200 emails per day on the free tier.
@jonathanmmm commented on GitHub (Apr 20, 2020):
I fixed it only after I changed the provider. I had two E-Mail Addresses from the same provider, both didn't work. So I changed to another. Even as both providers actually belong to the same big company it worked with the other provider. Don't know why, this time he could reach the smtp server (a diffferent dns name, as the first provider) and everything worked.
Had already the problem that the Provider has an automatic system, as if you normally send 3 E-Mails a day and you connect it to a logging service and you send like 100 E-Mails a day that you can get blocked to send any E-Mail, more than 3 or so. This is spam protection. Switching to the free trial of the premium plan and back resetted this timer. You have to train it that you send more E-Mails. This is probably not important, as Bitwarden does send very few E-Mails, wanted still to give my experience.
@maeries commented on GitHub (Apr 20, 2020):
You both are right. The provider was the problem. I already had tested autistici.org which also caused the LetreErr. Now I'm using hosteurope.de with SSL, without explicit TLS and port 587. That works
@floatingpurr commented on GitHub (Jun 25, 2020):
Same problem here with the SMTP config for a Gmail account. I cannot figure out how to use Gmail without enabling less secure apps...
@ghost commented on GitHub (Sep 10, 2020):
i have less secure apps and doesn't works. I've tried all the settings mentioned here.
Anyone that has it working can post the configuration used for gmail ?
Thanks in advance
@ScarlitoDoBrazil commented on GitHub (Sep 24, 2020):
Hi ppadial.
I finaly got it working ! Here is the configuration I use :
Enabled : true
Host : smtp.gmail.com
Enable SSL : true
Use explicit TLS : false
Port : 587
From Address : my_gmail_address@gmail.com
From Name : < The Name I want to show as Sender >
Password : < the "less secure app" password >
Json form auth mechanism : empty
SMTP connection timeout : 15
Server name sent during HELO : empty
I saved the settings before testing.
Hope this can help to make it work for you and others.
Regards.
@ghost commented on GitHub (Sep 30, 2020):
Thank you very much, i got it working too!!
@ghost commented on GitHub (Jan 24, 2021):
YOU ARE A GENIUS! THIS WORKED!