Incomplete Two-Step Login Mail Loop

After not completing a login, i get two mails every minute with the time of that login since. After a couple hundred and trying to restart the container, which unfortunately didn’t help, i’ve stopped the container for now.

Did anybody have the same problem and how could i solve this loop?

The client which started it, isn’t online anymore and Vaultwarden is still actively sending them

Debug log when mail is being sent:

[2026-10-08 21:55:55.316][vaultwarden::api::core::two_factor][INFO] User XXXXX did not complete a 2FA login within the configured time limit. IP: 192.168.1.12
[2026-10-08 21:55:55.325][rustls::webpki::anchors][DEBUG] add_parsable_certificates processed 150 valid and 0 invalid certs
[2026-10-08 21:55:55.327][rustls::client::hs][DEBUG] No cached session for DnsName(“mail.XXX.XXX”)
[2026-10-08 21:55:55.327][rustls::client::hs][DEBUG] Not resuming any session
[2026-10-08 21:55:55.329][rustls::client::hs][DEBUG] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2026-10-08 21:55:55.329][rustls::client::tls13][DEBUG] Not resuming
[2026-10-08 21:55:55.329][rustls::client::tls13][DEBUG] TLS1.3 encrypted extensions: ServerExtensions { unknown_extensions: {}, .. }
[2026-10-08 21:55:55.329][rustls::client::hs][DEBUG] ALPN protocol is None
[2026-10-08 21:55:55.466][rustls::common_state][DEBUG] Sending warning alert CloseNotify

Edit: i’ve removed the two rows in my PostgreSQL database in table public.twofactor_incomplete it’s silent now, but the problem shouldnt come back

On self-hosted Vaultwarden I’ve hit the same loop when SMTP delivery is delayed past the 2FA mail window. I check mail logs first (queue / deferred), confirm the instance clock is NTP-synced, and keep the browser tab open so the code can be pasted as soon as it lands. If the mail never arrives, fixing relay auth or SPF for the From domain usually matters more than regenerating codes. Temporarily using TOTP while SMTP is unhealthy avoids locking yourself out of the admin path.