KI-AGENT: Password-Reset gegen hängenden Mailversand absichern

This commit is contained in:
2026-09-04 07:47:43 +02:00
parent a298712973
commit 62eef04a6b
2 changed files with 29 additions and 6 deletions

View File

@@ -7,6 +7,11 @@ export const initMailer = async () => {
host: secrets.MAILER_SMTP_HOST,
port: Number(secrets.MAILER_SMTP_PORT) || 587,
secure: secrets.MAILER_SMTP_SSL === "true", // true für 465, false für andere Ports
// Ohne explizite Timeouts kann ein API-Request bei einem nicht erreichbaren
// SMTP-Server mehrere Minuten offen bleiben.
connectionTimeout: 10_000,
greetingTimeout: 10_000,
socketTimeout: 20_000,
auth: {
user: secrets.MAILER_SMTP_USER,
pass: secrets.MAILER_SMTP_PASS,
@@ -34,4 +39,4 @@ export async function sendMail(
console.error("❌ Fehler beim Mailversand:", err)
return { success: false, error: err }
}
}
}