From 60baeb3271bfc1422aa86ba336862fcc880ca6fc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 12:12:37 +0000 Subject: [PATCH] Mailversand: Antwortadresse, Absendername WEBklar, nur mit STARTTLS - SMTP_REPLY_TO (z. B. support@webklar.com) setzt Reply-To auf allen Kundenmails, damit Antworten nicht im Versandpostfach (noreply@) landen - Absendername einheitlich "WEBklar" (Kunden) bzw. "WEBklar Kundenbereich" (interne Hinweise) statt "Webklar"/"Webklar Kundenportal" - requireTLS auf Port 587: der neue Mailserver (Hetzner) nimmt die Anmeldung auch unverschluesselt an; ohne STARTTLS wird jetzt nicht gesendet Co-Authored-By: Claude Opus 5.5 --- server/config.js | 2 ++ server/services/mailer.js | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/config.js b/server/config.js index fee536c..9763869 100644 --- a/server/config.js +++ b/server/config.js @@ -141,6 +141,8 @@ export const config = { user: process.env.SMTP_USERNAME || '', pass: process.env.SMTP_PASSWORD || '', from: process.env.SMTP_FROM || process.env.SMTP_USERNAME || '', + // Antworten auf Kundenmails landen hier statt im Versandpostfach (noreply@) + replyTo: process.env.SMTP_REPLY_TO || '', }, chatNotify: { diff --git a/server/services/mailer.js b/server/services/mailer.js index 0445dce..41a219c 100644 --- a/server/services/mailer.js +++ b/server/services/mailer.js @@ -10,6 +10,8 @@ function getTransporter() { host: config.smtp.host, port: config.smtp.port, secure: config.smtp.secure, + // Port 587: ohne STARTTLS nicht senden (Hetzner erlaubt die Anmeldung auch unverschluesselt) + requireTLS: !config.smtp.secure, auth: { user: config.smtp.user, pass: config.smtp.pass }, }) } @@ -37,7 +39,7 @@ export async function sendChatNotification(customer, text) { const name = customer.name || customer.email || 'Kunde' await mailer.sendMail({ - from: `"Webklar Kundenportal" <${config.smtp.from}>`, + from: `"WEBklar Kundenbereich" <${config.smtp.from}>`, to: config.chatNotify.emails.join(', '), subject: `Neue Portalnachricht von ${name}`, text: [ @@ -65,7 +67,7 @@ export async function sendAdminNotice(subject, lines) { const mailer = getTransporter() if (!mailer || !config.chatNotify.emails.length) return { sent: false, reason: 'nicht konfiguriert' } await mailer.sendMail({ - from: `"Webklar Kundenportal" <${config.smtp.from}>`, + from: `"WEBklar Kundenbereich" <${config.smtp.from}>`, to: config.chatNotify.emails.join(', '), subject: `[Abo] ${subject}`, text: lines.join('\n'), @@ -86,7 +88,8 @@ export async function sendCustomerMail(to, subject, lines, attachments = []) { const mailer = getTransporter() if (!mailer) throw new Error('SMTP nicht konfiguriert') return mailer.sendMail({ - from: `"Webklar" <${config.smtp.from}>`, + from: `"WEBklar" <${config.smtp.from}>`, + replyTo: config.smtp.replyTo || undefined, to, bcc: config.chatNotify.emails.join(', ') || undefined, subject,