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 <noreply@anthropic.com>
This commit is contained in:
1 parent
32e441c8bc
commit
60baeb3271
2 files changed
+8
-3
No files matched your search
@@ -141,6 +141,8 @@ export const config = {
|
|||||||
user: process.env.SMTP_USERNAME || '',
|
user: process.env.SMTP_USERNAME || '',
|
||||||
pass: process.env.SMTP_PASSWORD || '',
|
pass: process.env.SMTP_PASSWORD || '',
|
||||||
from: process.env.SMTP_FROM || process.env.SMTP_USERNAME || '',
|
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: {
|
chatNotify: {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ function getTransporter() {
|
|||||||
host: config.smtp.host,
|
host: config.smtp.host,
|
||||||
port: config.smtp.port,
|
port: config.smtp.port,
|
||||||
secure: config.smtp.secure,
|
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 },
|
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'
|
const name = customer.name || customer.email || 'Kunde'
|
||||||
await mailer.sendMail({
|
await mailer.sendMail({
|
||||||
from: `"Webklar Kundenportal" <${config.smtp.from}>`,
|
from: `"WEBklar Kundenbereich" <${config.smtp.from}>`,
|
||||||
to: config.chatNotify.emails.join(', '),
|
to: config.chatNotify.emails.join(', '),
|
||||||
subject: `Neue Portalnachricht von ${name}`,
|
subject: `Neue Portalnachricht von ${name}`,
|
||||||
text: [
|
text: [
|
||||||
@@ -65,7 +67,7 @@ export async function sendAdminNotice(subject, lines) {
|
|||||||
const mailer = getTransporter()
|
const mailer = getTransporter()
|
||||||
if (!mailer || !config.chatNotify.emails.length) return { sent: false, reason: 'nicht konfiguriert' }
|
if (!mailer || !config.chatNotify.emails.length) return { sent: false, reason: 'nicht konfiguriert' }
|
||||||
await mailer.sendMail({
|
await mailer.sendMail({
|
||||||
from: `"Webklar Kundenportal" <${config.smtp.from}>`,
|
from: `"WEBklar Kundenbereich" <${config.smtp.from}>`,
|
||||||
to: config.chatNotify.emails.join(', '),
|
to: config.chatNotify.emails.join(', '),
|
||||||
subject: `[Abo] ${subject}`,
|
subject: `[Abo] ${subject}`,
|
||||||
text: lines.join('\n'),
|
text: lines.join('\n'),
|
||||||
@@ -86,7 +88,8 @@ export async function sendCustomerMail(to, subject, lines, attachments = []) {
|
|||||||
const mailer = getTransporter()
|
const mailer = getTransporter()
|
||||||
if (!mailer) throw new Error('SMTP nicht konfiguriert')
|
if (!mailer) throw new Error('SMTP nicht konfiguriert')
|
||||||
return mailer.sendMail({
|
return mailer.sendMail({
|
||||||
from: `"Webklar" <${config.smtp.from}>`,
|
from: `"WEBklar" <${config.smtp.from}>`,
|
||||||
|
replyTo: config.smtp.replyTo || undefined,
|
||||||
to,
|
to,
|
||||||
bcc: config.chatNotify.emails.join(', ') || undefined,
|
bcc: config.chatNotify.emails.join(', ') || undefined,
|
||||||
subject,
|
subject,
|
||||||
|
|||||||
Reference in new issue
Block a user