mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Set sensible SMTP timeout #475
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 @Kidswiss on GitHub (Nov 5, 2019).
When SMTP is enabled it will send a "new device" mail to the user's configured mail address. If that mail server is unreachable for some reason, or misconfigured, it will hang indefinitely with following log entries on the server:
On the client (Chrome):

Enabling debugging I saw that the server is hanging trying to connect to the SMTP host to send the "new device" mail, seemingly forever.
As discussed in #687 with @BlackDex there was already a discussion about this on the matrix chat on October 18.
@dani-garcia commented on GitHub (Nov 5, 2019):
I think by default the timeout is 60 seconds, but it makes sense to reduce it, and maybe allow it to be configurable too.
@Kidswiss commented on GitHub (Nov 6, 2019):
You're right after some time it prints something about login success in the log (sorry currently at work can't get you the exact logs...).
But that may be too long as the client will never receive that information and gets stuck.
@dani-garcia commented on GitHub (Nov 9, 2019):
Resolved in #711, you can use SMTP_TIMEOUT=xx to set the timeout in seconds.
@Kidswiss commented on GitHub (Nov 9, 2019):
Awesome! Thanks for the quick fix!