Error sending SMTP test email LetreErr #1764

Closed
opened 2025-10-09 17:29:16 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @baahver on GitHub.

I'm having trouble with the configuration of smtp. Sending mail was working before. I was using localhost smtp on port 25 without tls ssl.
But now unsecure smtp is changed to opportunistc if I understand it well.
https://github.com/dani-garcia/bitwarden_rs/pull/901
I used unsecure port 25 because I had problems with setting up tls or ssl.

Now I use:
-e SMTP_HOST=smtp.example.com \ -e SMTP_SSL=true \ -e SMTP_PORT=587 \ -e SMTP_FROM=info@example.com \ -e SMTP_USERNAME=info@example.com \ -e SMTP_PASSWORD=<mypassword> \

If I try to send a test mail I get: "Error sending SMTP test email LetreErr"
and:
tail -fn20 /bw-data/bitwarden.log shows me this:
2020-03-19 12:16:10][request][INFO] POST /admin/test/smtp/ [2020-03-19 12:16:11][lettre::smtp][INFO] connection established to <Serversaddress>:587 [2020-03-19 12:16:11][error][ERROR] LetreErr. [CAUSE] Io( Custom { kind: Other, error: Failure( Ssl( Error { code: ErrorCode( 1, ), cause: Some( Ssl( ErrorStack( [ Error { code: 337047686, library: "SSL routines", function: "tls_process_server_certificate", reason: "certificate verify failed", file: "../ssl/statem/statem_clnt.c", line: 1915, }, ], ), ), ), }, X509VerifyResult { code: 62, error: "Hostname mismatch", }, ), ), }, ) [2020-03-19 12:16:11][response][INFO] POST /admin/test/smtp (test_smtp) => 400 Bad Request

I'm using postfix on Ubuntu server with bitwarden in a docker on Apache2 with proxy installed. All was woring well before.
Anyone does have a clue what my problem is here?

Originally created by @baahver on GitHub. I'm having trouble with the configuration of smtp. Sending mail was working before. I was using localhost smtp on port 25 without tls ssl. But now unsecure smtp is changed to opportunistc if I understand it well. https://github.com/dani-garcia/bitwarden_rs/pull/901 I used unsecure port 25 because I had problems with setting up tls or ssl. Now I use: `-e SMTP_HOST=smtp.example.com \ -e SMTP_SSL=true \ -e SMTP_PORT=587 \ -e SMTP_FROM=info@example.com \ -e SMTP_USERNAME=info@example.com \ -e SMTP_PASSWORD=<mypassword> \` If I try to send a test mail I get: "Error sending SMTP test email LetreErr" and: tail -fn20 /bw-data/bitwarden.log shows me this: `2020-03-19 12:16:10][request][INFO] POST /admin/test/smtp/ [2020-03-19 12:16:11][lettre::smtp][INFO] connection established to <Serversaddress>:587 [2020-03-19 12:16:11][error][ERROR] LetreErr. [CAUSE] Io( Custom { kind: Other, error: Failure( Ssl( Error { code: ErrorCode( 1, ), cause: Some( Ssl( ErrorStack( [ Error { code: 337047686, library: "SSL routines", function: "tls_process_server_certificate", reason: "certificate verify failed", file: "../ssl/statem/statem_clnt.c", line: 1915, }, ], ), ), ), }, X509VerifyResult { code: 62, error: "Hostname mismatch", }, ), ), }, ) [2020-03-19 12:16:11][response][INFO] POST /admin/test/smtp (test_smtp) => 400 Bad Request` I'm using postfix on Ubuntu server with bitwarden in a docker on Apache2 with proxy installed. All was woring well before. Anyone does have a clue what my problem is here?
OVERLORD added the better for forum label 2025-10-09 17:29:16 +03:00
Author
Owner

@baahver commented on GitHub:

Ok thank you. I will try it later after an update then.
It would be better if I managed to activate a ssl/tls connection then.
If you have some suggestions on that, that would be great.
Thanks a lot Dani-Garcia for all the good work!

@baahver commented on GitHub: Ok thank you. I will try it later after an update then. It would be better if I managed to activate a ssl/tls connection then. If you have some suggestions on that, that would be great. Thanks a lot Dani-Garcia for all the good work!
Author
Owner

@baahver commented on GitHub:

Ok. I just pulled the 'new' version. And all is working well now.
Stil do not know why smtp over ssl or tls is not working in my system.

@baahver commented on GitHub: Ok. I just pulled the 'new' version. And all is working well now. Stil do not know why smtp over ssl or tls is not working in my system.
Author
Owner

@dani-garcia commented on GitHub:

As the issue is fixed I'm closing this, about why the certificate isn't working, I'm assuming the certificate provided by the server doesn't match the host name in the config, and that's why you get a "Hostname mismatch" there.

@dani-garcia commented on GitHub: As the issue is fixed I'm closing this, about why the certificate isn't working, I'm assuming the certificate provided by the server doesn't match the host name in the config, and that's why you get a "Hostname mismatch" there.
Author
Owner

@dani-garcia commented on GitHub:

Yeah the change to opportunistic TLS has broken a couple of configs before, so I've reverted it for now. In some hours the new builds will be available.

@dani-garcia commented on GitHub: Yeah the change to opportunistic TLS has broken a couple of configs before, so I've reverted it for now. In some hours the new builds will be available.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1764