Mail: timeout per stap met fase en verstreken tijd in het log

De SMTP-verzender gaf alle stappen samen een tijdsbudget; nu krijgt elke stap (verbinden met STARTTLS,
inloggen, versturen) zijn eigen volledige timeout. Bij een timeout noemt de code de stap
(timeout_connect, timeout_auth, timeout_send) en toont het log per stap de verstreken milliseconden.
TimeoutSeconds blijft instelbaar (standaard 10), bereik nu 1 tot 120. Infra-doc met veiligheidsmodus,
timeout en leeswijzer voor het journal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 01:30:16 +01:00
co-authored by Claude Sonnet 5.5
parent 892c548931
commit 190deb0da8
13 changed files with 168 additions and 22 deletions
@@ -5,7 +5,7 @@ const t = (key: string) => key;
describe('mailErrorText', () => {
it.each([
'timeout', 'auth_failed', 'rejected', 'rejected_sender', 'rejected_recipient', 'tls_failed', 'connection_failed', 'not_configured', 'unknown',
'timeout', 'timeout_connect', 'timeout_auth', 'timeout_send', 'auth_failed', 'rejected', 'rejected_sender', 'rejected_recipient', 'tls_failed', 'connection_failed', 'not_configured', 'unknown',
])('has its own text for %s', (code) => {
expect(mailErrorText(t, code)).toBe(`users.invite.mailErrors.${code}`);
});
+1 -1
View File
@@ -1,7 +1,7 @@
/** A short, human reason for a failed mail (codes come from the server; unknown codes read as generic). */
export function mailErrorText(t: (key: string) => string, error: string | null | undefined): string {
const known = [
'timeout', 'auth_failed', 'rejected', 'rejected_sender', 'rejected_recipient',
'timeout', 'timeout_connect', 'timeout_auth', 'timeout_send', 'auth_failed', 'rejected', 'rejected_sender', 'rejected_recipient',
'tls_failed', 'connection_failed', 'not_configured', 'unknown',
];
return t(`users.invite.mailErrors.${known.includes(error ?? '') ? error : 'unknown'}`);
@@ -167,6 +167,9 @@
"mailFailed": "The e-mail could not be sent ({{reason}}). Copy the link and share it yourself, or try e-mailing again later.",
"mailErrors": {
"timeout": "the mail server did not respond in time",
"timeout_connect": "the mail server did not respond in time while connecting",
"timeout_auth": "the mail server did not respond in time while signing in",
"timeout_send": "the mail server did not respond in time while sending",
"auth_failed": "signing in to the mail server failed",
"rejected": "the mail server or the address refused the message",
"rejected_sender": "the mail server does not accept this sender address for this account",
@@ -168,6 +168,9 @@
"mailFailed": "De e-mail kon niet worden verstuurd ({{reason}}). Kopieer de link en deel die zelf, of probeer later opnieuw te mailen.",
"mailErrors": {
"timeout": "de mailserver reageerde niet op tijd",
"timeout_connect": "de mailserver reageerde niet op tijd tijdens het verbinden",
"timeout_auth": "de mailserver reageerde niet op tijd tijdens het inloggen",
"timeout_send": "de mailserver reageerde niet op tijd tijdens het versturen",
"auth_failed": "inloggen op de mailserver mislukt",
"rejected": "de mailserver of het adres weigerde het bericht",
"rejected_sender": "de mailserver accepteert dit afzenderadres niet voor dit account",