Add option to disable starttls
authorChocobozzz <me@florianbigard.com>
Thu, 22 Mar 2018 15:12:52 +0000 (16:12 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 22 Mar 2018 15:12:52 +0000 (16:12 +0100)
config/default.yaml
config/production.yaml.example
config/test.yaml
server/initializers/constants.ts
server/lib/emailer.ts
support/docker/production/config/production.yaml

index 48e5bd067762d0db5964980ada4fa10af002e72a..26fc5c1283ed8bb0158c720cce5e44339e06bfed 100644 (file)
@@ -25,6 +25,7 @@ smtp:
   username: null
   password: null
   tls: true
+  disable_starttls: false
   ca_file: null # Used for self signed certificates
   from_address: 'admin@example.com'
 
index 45eeffec71ae8ddad1f61e79e125505433c7d307..43f45ae80e33fbe3a8b16f28a002af0137e36e78 100644 (file)
@@ -26,6 +26,7 @@ smtp:
   username: null
   password: null
   tls: true
+  disable_starttls: false
   ca_file: null # Used for self signed certificates
   from_address: 'admin@example.com'
 
index b830a42e7d7aa0ba8480906bada7a0202ac2052b..7e395db04e09a4bd871850ac97f16b9bf8696560 100644 (file)
@@ -12,6 +12,7 @@ smtp:
   hostname: null
   port: 1025
   tls: false
+  disable_starttls: true
   from_address: 'test-admin@localhost'
   username: null
   password: null
index 3cf9ea36d74c707fb93d6e11b960ce56903063a7..705d9b5200e8a53a0ad097bf4f785e27648e3e21 100644 (file)
@@ -106,6 +106,7 @@ const CONFIG = {
     USERNAME: config.get<string>('smtp.username'),
     PASSWORD: config.get<string>('smtp.password'),
     TLS: config.get<boolean>('smtp.tls'),
+    DISABLE_STARTTLS: config.get<boolean>('smtp.disable_starttls'),
     CA_FILE: config.get<string>('smtp.ca_file'),
     FROM_ADDRESS: config.get<string>('smtp.from_address')
   },
index 1b905e5106a3162ff161cc318fc6c2f811009f55..f34d141ea92bcae376eef23efa641ab100ad5241 100644 (file)
@@ -46,7 +46,7 @@ class Emailer {
         secure: CONFIG.SMTP.TLS,
         debug: CONFIG.LOG.LEVEL === 'debug',
         logger: bunyanLogger as any,
-        ignoreTLS: isTestInstance() || CONFIG.SMTP.HOSTNAME === 'localhost' || CONFIG.SMTP.HOSTNAME === '127.0.0.1',
+        ignoreTLS: CONFIG.SMTP.DISABLE_STARTTLS,
         tls,
         auth
       })
index 9a6cb1094ab8ac78284eb8d23bee599c5424b895..fdcbeb5a0156376a8c979b6efe1f85476f997097 100644 (file)
@@ -28,6 +28,7 @@ smtp:
   username: null
   password: null
   tls: true
+  disable_starttls: false
   ca_file: null # Used for self signed certificates
   from_address: 'admin@example.com'