-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTP using Let's Encrypt cannot send emails #370
Comments
Sounds like you need to provide your the LE trust chain cert to the Bitwarden containers, so that they properly trust it. Place these certificates in |
Thanks! I had some time offline, so it took a couple of days I could try that. I copied the ISRG Root X1 and the two active intermediate authorities to bwdata/cs-certificates, stopped the containers, and restarted them. Nothing changed. Do you have another idea? Side note: I'm gonna use Bitwarden only for me and another person, actually I don't know if I really need to send emails, cause I don't know Bitwarden yet. Are there any important emailing functionalities? |
Same problem here with my mail server and a Let's Encrypt certificate.
|
@qspweissen: I switched to a temporary GMail account. I only needed the email to verify the two user accounts, don't know why I needed to verify them, if I remember it right, accounts only can join organizations if they are verified. After that, I didn't need emails anymore. So if you only have a few users, maybe just using GMail or another free service for this is a fast solution for you too. But I would also prefer this to be fixed, or at least a more detailed message in the logs, why the certificate can't be validated. I have no other troubles with my mailserver, so I'm not sure if it's a faulty webserver or a faulty certifiacte validation. |
I'm having a similar problem with the e-mail provider, mailjet.com. Their ssl cert is by digicert. I added all the ca certs from digicert into the ca-certificates directory and restarted but it still wouldn't work, I got the same error. |
Can you check the smtp address here to make sure there are no issues with the ssl cert? https://www.digicert.com/help/ |
Yes, I tested |
Same for me. Everthing is valid |
Six green checkmarks for me too. |
I am not sure why the connection is not being trusted then. Does anyone have a set of test SMTP credentials to a server with this problem that I can use to debug this with? You can PM me on the dev channel here https://gitter.im/bitwarden/Lobby |
@kspearrin you can create an account with mailjet.com. They offer 200 e-mails per day for free, which is why I use them for this. I don't anticipate needing to send anywhere near that many e-mails for personal use. |
@egyptianbman I created a free mailjet account and ran some tests tonight using
Very weird. Like you, I thought that this would suggest that the Debian docker container didn't have the DigiCert Root CA for whatever reason. So I bashed into the bitwarden-api container (this is the one that is sending emails) like so:
I then did a curl GET to DigiCert's Root CA test page and it works just fine:
I am a little confused as to what it could be at this point. |
@egyptianbman I then tried it without SSL, using port 25 and I get another exception:
|
I was actually able to get it to work with ssl disabled and used that to get access to the admin, then restarted the service to clear the credentials (since the link was sent insecurely) and re-enabled ssl. Yeah, I'm not sure what the deal is. This is a C# application so could it be that mono needs something to be able to access the root certs? |
I opened an issue here: dotnet/aspnetcore#6152 |
Thank you! |
I took another look at mailjet to see if anything had changed since quite some time has passed and I noticed a note that if port 587 doesn't work, to try 465. I did another trial with port 25, 587 and finally -- 465 -- which worked! This means my issue is resolved. My working configuration:
|
local smtp server with let's encrypt certificate and i am getting the same errors. Which files do i need to copy to ca-certificates or cs-certificates and what are the filenames the app is looking for? Is there any other workaround? |
Hi @cweilguny, |
Hi,
I have a new self hosted instance of bitwarden, and configured my mailserver as SMTP server. The mailserver uses a Let's Encrypt certificate for transport encryption. So I set port 587 and globalSettings__mail__smtp__ssl=true in the mailsettings and tried to send the verification mail. But sending fails, bwdata/logs/api/Api/20180929.txt shows this:
On my mailserver the mail.log says:
As the container has no timezone set, it's "kind of" 2 hours off (see the times of the two logs). So I tried to set the timezone in the bitwarden-api container to Europe/Vienna, to exclude the time for certificate issues. That didn't change anything.
The mail settings are as correct as I can set them. Port 587, SSL, username and password do work too (tried in my webmail client). The settings work in different clients, there I also don't have to accept invalid certificates. I also checked if the certificate is valid with
nmap -p 587 --script ssl-cert my-mail-server.example.com
and it's valid for the domain I used. Googlinglost connection after STARTTLS
gives some hints, that the sending server didn't accept the certificate, well, just like the bitwarden log says.So, here is the point, where I don't know how to research further. Any hints? Is it probably a known issue (didn't find anything here but I can't imagine that I'm the only bitwarden self-hoster that uses a mailserver with a let's encrypt certificate)?
The text was updated successfully, but these errors were encountered: