Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
fix: fixed ssl cert issue with secure
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Dec 4, 2019
1 parent 14d72d0 commit 196a9b8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ TXT_RECORD_PREFIX=forward-email
BLACKLIST=biz-catalogs.com
CERTBOT_WELL_KNOWN_NAME=
CERTBOT_WELL_KNOWN_CONTENTS=
IS_NOT_SECURE=false
1 change: 0 additions & 1 deletion .env.schema
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ DNSBL=
BLACKLIST=
CERTBOT_WELL_KNOWN_NAME=
CERTBOT_WELL_KNOWN_CONTENTS=
IS_NOT_SECURE=
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ const util = require('util');

const DKIM = require('nodemailer/lib/dkim');
const Limiter = require('ratelimiter');
const NodeDKIM = require('dkim');
const Promise = require('bluebird');
const Redis = require('@ladjs/redis');
const _ = require('lodash');
const addressParser = require('nodemailer/lib/addressparser');
const arrayJoinConjunction = require('array-join-conjunction');
const bytes = require('bytes');
const NodeDKIM = require('dkim');
const dmarcParse = require('dmarc-parse');
const dnsbl = require('dnsbl');
const domains = require('disposable-email-domains');
Expand All @@ -27,6 +27,7 @@ const spfCheck2 = require('python-spfcheck2');
const validator = require('validator');
const wildcards = require('disposable-email-domains/wildcard.json');
const { SMTPServer } = require('smtp-server');
const { boolean } = require('boolean');
const { oneLine } = require('common-tags');

let mailUtilities = require('mailin/lib/mailUtilities.js');
Expand Down Expand Up @@ -110,8 +111,8 @@ class ForwardEmail {
if (this.config.ssl.ca === null) delete this.config.ssl.ca;
// shared config automatically adds this
delete this.config.ssl.allowHTTP1;
this.config.ssl.secure =
!env.IS_NOT_SECURE || (this.config.ssl.key && this.config.ssl.cert);
if (boolean(process.env.IS_NOT_SECURE)) this.config.ssl.secure = false;
else this.config.ssl.secure = true;
this.config.smtp = {
...this.config.smtp,
...this.config.ssl
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@ladjs/shared-config": "^0.0.10",
"array-join-conjunction": "^1.0.0",
"bluebird": "^3.7.2",
"boolean": "^3.0.0",
"bytes": "^3.1.0",
"cabin": "^5.0.10",
"common-tags": "^1.8.0",
Expand Down

0 comments on commit 196a9b8

Please sign in to comment.