Add e-mail system: send applications, receive & reply to responses

Send the complete application (body + generated attachments) to a
user-entered address via authenticated SMTP submission through the
account's own server, so it applies DKIM and uses its reputable IP/PTR —
required for deliverability here (domain publishes SPF -all, DMARC
p=reject). From/Return-Path stay aligned on the sending domain.

Reply e-mails are polled over IMAP, parsed, stored and matched to the
right application (via In-Reply-To/References, then sender address);
their attachments are saved and downloadable. The detail page gains a
correspondence thread with compose, threaded reply, and an AI-drafted
reply the user can edit before sending.

New: lib/mailer.js (nodemailer + imapflow + mailparser), generateEmailReply
in lib/documents.js, emails/email_anhaenge/app_state tables, background
poller + manual fetch. Credentials come from MAIL_* env vars (.env, not
committed / not in the image).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 15:59:32 +02:00
co-authored by Claude Opus 4.8
parent 3c553cadf5
commit 0b44f61410
7 changed files with 1289 additions and 4 deletions
+3
View File
@@ -13,9 +13,12 @@
"dependencies": {
"ejs": "^3.1.9",
"express": "^4.18.2",
"imapflow": "^1.4.3",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.8.2",
"mailparser": "^3.9.12",
"multer": "^2.2.0",
"nodemailer": "^9.0.3",
"sqlite3": "^5.1.6"
},
"devDependencies": {