mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
🔓 Allow SMTP server to be configured without auth (#556)
This commit is contained in:
parent
d14a88e9eb
commit
c6e68c407c
1 changed files with 7 additions and 4 deletions
|
@ -22,14 +22,17 @@ const getTransport = () => {
|
||||||
if (env === "test") {
|
if (env === "test") {
|
||||||
transport = createTransport({ port: 4025 });
|
transport = createTransport({ port: 4025 });
|
||||||
} else {
|
} else {
|
||||||
|
const hasAuth = process.env.SMTP_USER || process.env.SMTP_PWD;
|
||||||
transport = createTransport({
|
transport = createTransport({
|
||||||
host: process.env.SMTP_HOST,
|
host: process.env.SMTP_HOST,
|
||||||
port: process.env.SMTP_PORT ? parseInt(process.env.SMTP_PORT) : undefined,
|
port: process.env.SMTP_PORT ? parseInt(process.env.SMTP_PORT) : undefined,
|
||||||
secure: process.env.SMTP_SECURE === "true",
|
secure: process.env.SMTP_SECURE === "true",
|
||||||
auth: {
|
auth: hasAuth
|
||||||
user: process.env.SMTP_USER,
|
? {
|
||||||
pass: process.env.SMTP_PWD,
|
user: process.env.SMTP_USER,
|
||||||
},
|
pass: process.env.SMTP_PWD,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return transport;
|
return transport;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue