From a618eeffeb15ba9d7c51b4275a3d1553fe4ccef7 Mon Sep 17 00:00:00 2001 From: Uwe Woessner Date: Fri, 23 Oct 2020 00:41:16 +0200 Subject: [PATCH] configurable mailserver and sender --- README.md | 2 +- config/email.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 327ddb4..3f1ff67 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,4 @@ By default in development mode mails are not sent, but instead the mail data is Mails are also always sent in production mode! -For actually sending e-mails the user and password for the SMTP server need to be specified as environment variables. The username is read from `MAILUSER`, and the password is read from `MAILPW`, so in local development startup would like something like this (at least in Linux): `MAILUSER=myuser MAILPW=supersecurepassword npm run dev -- --devSendMails`. \ No newline at end of file +For actually sending e-mails the mailserver, sender, user and password for the SMTP server need to be specified as environment variables. The username is read from `MAILUSER`, and the password is read from `MAILPW`, Mailserver is read from 'MAILSERVER' and the sender name from 'MAILSENDER', so in local development startup would like something like this (at least in Linux): `MAILSERVER=mail.my-domain.de MAILSENDER=noreply@whatever.de MAILUSER=myuser MAILPW=supersecurepassword npm run dev -- --devSendMails`. diff --git a/config/email.js b/config/email.js index 38884d6..12e0fb5 100644 --- a/config/email.js +++ b/config/email.js @@ -3,13 +3,13 @@ const forcedMail = process.argv.findIndex(s => s === '--devSendMails') !== -1; module.exports = { "sendMails": isProduction || forcedMail, - "emailFrom": "noreply@openbikesensor.org", + "emailFrom": process.env.MAILSENDER, "smtpOptions": { - "host": "mail.your-server.de", + "host": process.env.MAILSERVER, "port": 587, "auth": { "user": process.env.MAILUSER, "pass": process.env.MAILPW } } -}; \ No newline at end of file +};