Error sending email #344

Closed
opened 2026-02-20 08:01:33 -05:00 by deekerman · 7 comments
Owner

Originally created by @p3lim on GitHub (Jul 17, 2019).

Attempting to use Fastmail for SMTP, and syncing users from LDAP following the wiki page.

Here's my (redacted) compose file:

version: '3'
services:
  bitwarden:
    image: bitwardenrs/server:1.9.1
    restart: always
    volumes:
      - ./bw-data:/data
    environment:
      - WEBSOCKET_ENABLED=true
      - SIGNUPS_ALLOWED=false
      - INVITATIONS_ALLOWED=true
      - SMTP_HOST=smtp.fastmail.com
      - SMTP_FROM=foo@fastmail.com
      - SMTP_PORT=465
      - SMTP_SSL=true
      - SMTP_USERNAME=foo@fastmail.com
      - SMTP_PASSWORD=bar
      - DOMAIN=https://bitwarden.example.com
      - ADMIN_TOKEN=baz
  ldap:
    image: vividboarder/bitwarden_rs_ldap:latest
    restart: always
    depends_on:
      - bitwarden
    volumes:
      - ./ldap.toml:/config.toml:ro
    environment:
      - CONFIG_PATH=/config.toml

When the ldap service attempts an invite it timeouts, with bitwarden_rs throwing the following error:

[bitwarden_rs::error][ERROR] Error sending email. Complete

Is there any way to get more information than that, what exactly went wrong?

Originally created by @p3lim on GitHub (Jul 17, 2019). Attempting to use [Fastmail](https://www.fastmail.com/help/technical/servernamesandports.html) for SMTP, and syncing users from LDAP following the [wiki page](https://github.com/dani-garcia/bitwarden_rs/wiki/Syncing-users-from-LDAP). Here's my (redacted) compose file: ```yaml version: '3' services: bitwarden: image: bitwardenrs/server:1.9.1 restart: always volumes: - ./bw-data:/data environment: - WEBSOCKET_ENABLED=true - SIGNUPS_ALLOWED=false - INVITATIONS_ALLOWED=true - SMTP_HOST=smtp.fastmail.com - SMTP_FROM=foo@fastmail.com - SMTP_PORT=465 - SMTP_SSL=true - SMTP_USERNAME=foo@fastmail.com - SMTP_PASSWORD=bar - DOMAIN=https://bitwarden.example.com - ADMIN_TOKEN=baz ldap: image: vividboarder/bitwarden_rs_ldap:latest restart: always depends_on: - bitwarden volumes: - ./ldap.toml:/config.toml:ro environment: - CONFIG_PATH=/config.toml ``` When the ldap service attempts an invite it timeouts, with bitwarden_rs throwing the following error: ``` [bitwarden_rs::error][ERROR] Error sending email. Complete ``` Is there any way to get more information than that, what exactly went wrong?
Author
Owner

@p3lim commented on GitHub (Jul 17, 2019):

Complete logs, email addresses redacted:

ldap_1       | 2019-07-17T10:28:17.904808750Z Try to invite user: someuser@fastmail.com
bitwarden_1  | 2019-07-17T10:28:17.922424846Z [2019-07-17 10:28:17][rocket::rocket][INFO] POST /admin/invite application/json:
bitwarden_1  | 2019-07-17T10:28:17.922481147Z [2019-07-17 10:28:17][_][INFO] Matched: POST /admin/invite (invite_user)
ldap_1       | 2019-07-17T10:28:47.922780566Z thread 'main' panicked at 'Could not call with http://bitwarden:80/admin/invite. Error { kind: Io(Custom { kind: TimedOut, error: StringError("timed out") }), url: Some("http://bitwarden/admin/invite") }', src/bw_admin.rs:134:21
ldap_1       | 2019-07-17T10:28:47.922874851Z note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
bitwarden_1  | 2019-07-17T10:28:49.088176717Z [2019-07-17 10:28:49][rocket::rocket][INFO] POST /admin/ application/x-www-form-urlencoded:
bitwarden_1  | 2019-07-17T10:28:49.088257990Z [2019-07-17 10:28:49][_][INFO] Matched: POST /admin (post_admin_login)
bitwarden_1  | 2019-07-17T10:28:49.092042487Z [2019-07-17 10:28:49][_][INFO] Outcome: Success
bitwarden_1  | 2019-07-17T10:28:49.092105254Z [2019-07-17 10:28:49][_][INFO] Response succeeded.
bitwarden_1  | 2019-07-17T10:28:49.116387629Z [2019-07-17 10:28:49][rocket::rocket][INFO] GET /admin/users:
bitwarden_1  | 2019-07-17T10:28:49.116445315Z [2019-07-17 10:28:49][_][INFO] Matched: GET /admin/users (get_users)
bitwarden_1  | 2019-07-17T10:28:49.118417870Z [2019-07-17 10:28:49][_][INFO] Outcome: Success
bitwarden_1  | 2019-07-17T10:28:49.118456414Z [2019-07-17 10:28:49][_][INFO] Response succeeded.
ldap_1       | User with email already exists: someuser@fastmail.com
ldap_1       | Sent invites to 0 user(s).
bitwarden_1  | 2019-07-17T10:29:18.188538987Z [2019-07-17 10:29:18][bitwarden_rs::error][ERROR] Error sending email. Complete
bitwarden_1  | 2019-07-17T10:29:18.188618254Z [2019-07-17 10:29:18][_][INFO] Outcome: Success
bitwarden_1  | 2019-07-17T10:29:18.189187438Z [2019-07-17 10:29:18][_][INFO] Response succeeded.
@p3lim commented on GitHub (Jul 17, 2019): Complete logs, email addresses redacted: ``` ldap_1 | 2019-07-17T10:28:17.904808750Z Try to invite user: someuser@fastmail.com bitwarden_1 | 2019-07-17T10:28:17.922424846Z [2019-07-17 10:28:17][rocket::rocket][INFO] POST /admin/invite application/json: bitwarden_1 | 2019-07-17T10:28:17.922481147Z [2019-07-17 10:28:17][_][INFO] Matched: POST /admin/invite (invite_user) ldap_1 | 2019-07-17T10:28:47.922780566Z thread 'main' panicked at 'Could not call with http://bitwarden:80/admin/invite. Error { kind: Io(Custom { kind: TimedOut, error: StringError("timed out") }), url: Some("http://bitwarden/admin/invite") }', src/bw_admin.rs:134:21 ldap_1 | 2019-07-17T10:28:47.922874851Z note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. bitwarden_1 | 2019-07-17T10:28:49.088176717Z [2019-07-17 10:28:49][rocket::rocket][INFO] POST /admin/ application/x-www-form-urlencoded: bitwarden_1 | 2019-07-17T10:28:49.088257990Z [2019-07-17 10:28:49][_][INFO] Matched: POST /admin (post_admin_login) bitwarden_1 | 2019-07-17T10:28:49.092042487Z [2019-07-17 10:28:49][_][INFO] Outcome: Success bitwarden_1 | 2019-07-17T10:28:49.092105254Z [2019-07-17 10:28:49][_][INFO] Response succeeded. bitwarden_1 | 2019-07-17T10:28:49.116387629Z [2019-07-17 10:28:49][rocket::rocket][INFO] GET /admin/users: bitwarden_1 | 2019-07-17T10:28:49.116445315Z [2019-07-17 10:28:49][_][INFO] Matched: GET /admin/users (get_users) bitwarden_1 | 2019-07-17T10:28:49.118417870Z [2019-07-17 10:28:49][_][INFO] Outcome: Success bitwarden_1 | 2019-07-17T10:28:49.118456414Z [2019-07-17 10:28:49][_][INFO] Response succeeded. ldap_1 | User with email already exists: someuser@fastmail.com ldap_1 | Sent invites to 0 user(s). bitwarden_1 | 2019-07-17T10:29:18.188538987Z [2019-07-17 10:29:18][bitwarden_rs::error][ERROR] Error sending email. Complete bitwarden_1 | 2019-07-17T10:29:18.188618254Z [2019-07-17 10:29:18][_][INFO] Outcome: Success bitwarden_1 | 2019-07-17T10:29:18.189187438Z [2019-07-17 10:29:18][_][INFO] Response succeeded. ```
Author
Owner

@mprasil commented on GitHub (Jul 18, 2019):

I'm not sure what's going on, but to rule out any issues with the LDAP sync part, can you go to the admin interface (login with token) and try to send invite directly from there? See if you spot anything in logs.

@mprasil commented on GitHub (Jul 18, 2019): I'm not sure what's going on, but to rule out any issues with the LDAP sync part, can you go to the admin interface (login with token) and try to send invite directly from there? See if you spot anything in logs.
Author
Owner

@p3lim commented on GitHub (Jul 18, 2019):

Disabled the ldap sync service and attempted to invite manually, this is the complete log from when I clicked the invite button:

bitwarden_1  | 2019-07-18T07:32:03.654010403Z [2019-07-18 07:32:03][rocket::rocket][INFO] POST /admin/invite/ application/json:
bitwarden_1  | 2019-07-18T07:32:03.654083063Z [2019-07-18 07:32:03][_][INFO] Matched: POST /admin/invite (invite_user)
nginx_1      | 2019-07-18T07:33:03.654558141Z 2019/07/18 07:33:03 [error] 6#6: *44 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.20.0.2, server: bitwarden.lab, request: "POST /admin/invite/ HTTP/2.0", upstream: "http://192.168.100.2:80/admin/invite/", host: "bitwarden.lab", referrer: "https://bitwarden.lab/admin"
nginx_1      | 2019-07-18T07:33:03.655061160Z 10.20.0.2 - - [18/Jul/2019:07:33:03 +0000] "POST /admin/invite/ HTTP/2.0" 504 167 "https://bitwarden.lab/admin" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0" "-"
bitwarden_1  | 2019-07-18T07:33:03.925418295Z [2019-07-18 07:33:03][bitwarden_rs::error][ERROR] Error sending email. Complete
bitwarden_1  | 2019-07-18T07:33:03.925490447Z [2019-07-18 07:33:03][_][INFO] Outcome: Success
bitwarden_1  | 2019-07-18T07:33:03.925500583Z [2019-07-18 07:33:03][_][INFO] Response succeeded.

Also got a confirm popup in the browser saying "Error inviting user: Unknown error", I got this at the same time nginx reported the timeout in the logs.

@p3lim commented on GitHub (Jul 18, 2019): Disabled the ldap sync service and attempted to invite manually, this is the complete log from when I clicked the invite button: ``` bitwarden_1 | 2019-07-18T07:32:03.654010403Z [2019-07-18 07:32:03][rocket::rocket][INFO] POST /admin/invite/ application/json: bitwarden_1 | 2019-07-18T07:32:03.654083063Z [2019-07-18 07:32:03][_][INFO] Matched: POST /admin/invite (invite_user) nginx_1 | 2019-07-18T07:33:03.654558141Z 2019/07/18 07:33:03 [error] 6#6: *44 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.20.0.2, server: bitwarden.lab, request: "POST /admin/invite/ HTTP/2.0", upstream: "http://192.168.100.2:80/admin/invite/", host: "bitwarden.lab", referrer: "https://bitwarden.lab/admin" nginx_1 | 2019-07-18T07:33:03.655061160Z 10.20.0.2 - - [18/Jul/2019:07:33:03 +0000] "POST /admin/invite/ HTTP/2.0" 504 167 "https://bitwarden.lab/admin" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0" "-" bitwarden_1 | 2019-07-18T07:33:03.925418295Z [2019-07-18 07:33:03][bitwarden_rs::error][ERROR] Error sending email. Complete bitwarden_1 | 2019-07-18T07:33:03.925490447Z [2019-07-18 07:33:03][_][INFO] Outcome: Success bitwarden_1 | 2019-07-18T07:33:03.925500583Z [2019-07-18 07:33:03][_][INFO] Response succeeded. ``` Also got a confirm popup in the browser saying "Error inviting user: Unknown error", I got this at the same time nginx reported the timeout in the logs.
Author
Owner

@p3lim commented on GitHub (Jul 18, 2019):

My nginx config, sans SSL options:

server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
	server_name bitwarden.lab;
	
	# ssl params
	
	client_max_body_size 128M;
	
	location / {
		proxy_pass http://bitwarden:80/;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
	
	location /notifications/hub {
		proxy_pass http://bitwarden:3012;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
	}
	
	location /notifications/hub/negotiate {
		proxy_pass http://bitwarden:80/;
	}
}
@p3lim commented on GitHub (Jul 18, 2019): My nginx config, sans SSL options: ``` server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name bitwarden.lab; # ssl params client_max_body_size 128M; location / { proxy_pass http://bitwarden:80/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /notifications/hub { proxy_pass http://bitwarden:3012; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /notifications/hub/negotiate { proxy_pass http://bitwarden:80/; } } ```
Author
Owner

@Skaronator commented on GitHub (Aug 4, 2019):

I had similar issues. Enabling "Use explicit TLS" in the Admin Panel did the trick! Just wondering if there is a environment variable to set this setting.

image

@Skaronator commented on GitHub (Aug 4, 2019): I had similar issues. Enabling "Use explicit TLS" in the Admin Panel did the trick! Just wondering if there is a environment variable to set this setting. ![image](https://user-images.githubusercontent.com/2886913/62426925-7cddef00-b6eb-11e9-8eba-25b11c5c1368.png)
Author
Owner

@Skaronator commented on GitHub (Aug 4, 2019):

SMTP_EXPLICIT_TLS=true did it.

image

@Skaronator commented on GitHub (Aug 4, 2019): `SMTP_EXPLICIT_TLS=true` did it. ![image](https://user-images.githubusercontent.com/2886913/62426939-c75f6b80-b6eb-11e9-8e43-8ba8ba416373.png)
Author
Owner

@p3lim commented on GitHub (Aug 12, 2019):

That solved it for me, thanks!

@p3lim commented on GitHub (Aug 12, 2019): That solved it for me, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#344
No description provided.