mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
fix: uri encode smtp connection string (#901)
Signed-off-by: James Renaud <james.renaud@mitel.com> Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
This commit is contained in:
parent
ff7be7696c
commit
8f1a5f5a64
@ -2,6 +2,7 @@ import { createTransport, Transporter } from 'nodemailer';
|
||||
import Mustache from 'mustache';
|
||||
import path from 'path';
|
||||
import { readFileSync, existsSync } from 'fs';
|
||||
import { escape } from 'querystring';
|
||||
import { Logger, LogProvider } from '../logger';
|
||||
import NotFoundError from '../error/notfound-error';
|
||||
import { IEmailOption } from '../types/option';
|
||||
@ -57,7 +58,9 @@ export class EmailService {
|
||||
if (email.host === 'test') {
|
||||
this.mailer = createTransport({ jsonTransport: true });
|
||||
} else {
|
||||
const connectionString = `${email.smtpuser}:${email.smtppass}@${email.host}:${email.port}`;
|
||||
const connectionString = escape(
|
||||
`${email.smtpuser}:${email.smtppass}@${email.host}:${email.port}`,
|
||||
);
|
||||
this.mailer = email.secure
|
||||
? createTransport(`smtps://${connectionString}`)
|
||||
: createTransport(`smtp://${connectionString}`);
|
||||
|
Loading…
Reference in New Issue
Block a user