This commit is contained in:
Leandro Facchinetti 2020-03-20 22:45:29 -04:00
parent 581fb3f814
commit dc4e6632a2
1 changed files with 2 additions and 14 deletions

View File

@ -38,7 +38,7 @@ export const webServer = express()
.listen(8000); .listen(8000);
export const emailServer = new SMTPServer({ export const emailServer = new SMTPServer({
authOptional: true, disabledCommands: ["AUTH", "STARTTLS"],
async onData(stream, session, callback) { async onData(stream, session, callback) {
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$/);
@ -68,19 +68,7 @@ export const emailServer = new SMTPServer({
fs.writeFileSync(path, renderXML(xml)); fs.writeFileSync(path, renderXML(xml));
} }
callback(); callback();
}, }
...(process.env.NODE_ENV === "production"
? {
key: fs.readFileSync(
"/etc/letsencrypt/live/kill-the-newsletter.com/privkey.pem",
"utf8"
),
cert: fs.readFileSync(
"/etc/letsencrypt/live/kill-the-newsletter.com/fullchain.pem",
"utf8"
)
}
: {})
}).listen(process.env.NODE_ENV === "production" ? 25 : 2525); }).listen(process.env.NODE_ENV === "production" ? 25 : 2525);
function Layout({ children }: { children: React.ReactNode }) { function Layout({ children }: { children: React.ReactNode }) {