This commit is contained in:
parent
b6dabd2386
commit
d984e361f5
|
@ -39,7 +39,8 @@ export const webServer = express()
|
||||||
|
|
||||||
export const emailServer = new SMTPServer({
|
export const emailServer = new SMTPServer({
|
||||||
disabledCommands: ["AUTH", "STARTTLS"],
|
disabledCommands: ["AUTH", "STARTTLS"],
|
||||||
async onData(stream, session, callback) {
|
onData(stream, session, callback) {
|
||||||
|
(async () => {
|
||||||
const paths = session.envelope.rcptTo.flatMap(({ address }) => {
|
const paths = session.envelope.rcptTo.flatMap(({ address }) => {
|
||||||
const match = address.match(/^(\w+)@kill-the-newsletter.com$/);
|
const match = address.match(/^(\w+)@kill-the-newsletter.com$/);
|
||||||
if (match === null) return [];
|
if (match === null) return [];
|
||||||
|
@ -68,6 +69,7 @@ export const emailServer = new SMTPServer({
|
||||||
fs.writeFileSync(path, renderXML(xml));
|
fs.writeFileSync(path, renderXML(xml));
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
|
})().catch(callback);
|
||||||
}
|
}
|
||||||
}).listen(process.env.NODE_ENV === "production" ? 25 : 2525);
|
}).listen(process.env.NODE_ENV === "production" ? 25 : 2525);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue