Skip to content

Commit

Permalink
Removed nodemailer-direct-transport, had critical vulnerability and w…
Browse files Browse the repository at this point in the history
…asn't being maintained

  - Can no longer use direct transport in nodemailer
Updated vite, oidc-client-ts to fix vulnerabilities
  • Loading branch information
mhaswell-bcgov committed May 16, 2024
1 parent cfc363a commit a9bcb70
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 234 deletions.
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"jquery-ui-bundle": "^1.12.1",
"less": "^4.1.1",
"lodash": "^4.17.21",
"oidc-client-ts": "^2.2.4",
"oidc-client-ts": "^2.4.0",
"pinia": "^2.1.4",
"vite": "^4.2.0",
"vite": "^4.5.3",
"vite-plugin-vuetify": "^1.0.0"
},
"eslintConfig": {
Expand Down
331 changes: 175 additions & 156 deletions client/yarn.lock

Large diffs are not rendered by default.

66 changes: 2 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notify-bc",
"version": "4.1.12",
"version": "4.2.0",
"dbSchemaVersion": "0.8.0",
"description": "A versatile notification API server",
"keywords": [
Expand Down Expand Up @@ -87,7 +87,6 @@
"morgan": "^1.10.0",
"node-rsa": "^0.4.1",
"nodemailer": "^6.7.3",
"nodemailer-direct-transport": "^3.3.2",
"pluralize": "^7.0.0",
"randexp": "^0.4.3",
"semver": "^5.3.0",
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const config: AnyObject = {
siteMinderReverseProxyIps: ['127.0.0.1'],
email: {
defaultSmtp: {
direct: true,
name: 'localhost',
host: 'localhost',
port: 25,
},
inboundSmtpServer: {
enabled: true,
Expand Down
9 changes: 1 addition & 8 deletions src/controllers/base.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,13 @@ export class BaseController {
}

nodemailer = require('nodemailer');
directTransport = require('nodemailer-direct-transport');
transport: any;
static emailLimiter: Bottleneck;
async sendEmail(mailOptions: any) {
const smtpCfg =
this.appConfig.email.smtp || this.appConfig.email.defaultSmtp;
if (!this.transport) {
if (smtpCfg.direct) {
this.transport = this.nodemailer.createTransport(
this.directTransport(smtpCfg),
);
} else {
this.transport = this.nodemailer.createTransport(smtpCfg);
}
this.transport = this.nodemailer.createTransport(smtpCfg);
}
if (
!BaseController.emailLimiter &&
Expand Down

0 comments on commit a9bcb70

Please sign in to comment.