Browse Source

Try to fix MAIL_FROM.

Thanks to xet7 !

Fixes #3972,
fixes #3975,
fixes #3969
Lauri Ojansivu 3 years ago
parent
commit
787df04419
5 changed files with 5 additions and 14 deletions
  1. 0 5
      Dockerfile
  2. 2 6
      models/settings.js
  3. 1 1
      models/users.js
  4. 1 1
      server/notifications/email.js
  5. 1 1
      server/rulesHelper.js

+ 0 - 5
Dockerfile

@@ -21,11 +21,6 @@ ENV BUILD_DEPS="apt-utils libarchive-tools gnupg gosu wget curl bzip2 g++ build-
     ARCHITECTURE=linux-x64 \
     SRC_PATH=./ \
     WITH_API=true \
-    MAIL_URL="" \
-    MAIL_FROM="" \
-    MAIL_SERVICE="" \
-    MAIL_SERVICE_USER="" \
-    MAIL_SERVICE_PASSWORD="" \
     RESULTS_PER_PAGE="" \
     ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURES_BEFORE=3 \
     ACCOUNTS_LOCKOUT_KNOWN_USERS_PERIOD=60 \

+ 2 - 6
models/settings.js

@@ -159,7 +159,6 @@ if (Meteor.isServer) {
       };
       Settings.insert(defaultSetting);
     }
-    /*
     if (isSandstorm) {
       // At Sandstorm, Admin Panel has SMTP settings
       const newSetting = Settings.findOne();
@@ -172,9 +171,7 @@ if (Meteor.isServer) {
       // Not running on Sandstorm, so using environment variables
       Accounts.emailTemplates.from = process.env.MAIL_FROM;
     }
-    */
   });
-  /*
   if (isSandstorm) {
     // At Sandstorm Wekan Admin Panel, save SMTP settings.
     Settings.after.update((userId, doc, fieldNames) => {
@@ -194,7 +191,6 @@ if (Meteor.isServer) {
       }
     });
   }
-  */
 
   function getRandomNum(min, max) {
     const range = max - min;
@@ -241,7 +237,7 @@ if (Meteor.isServer) {
           subject: TAPi18n.__('email-invite-register-subject', params, lang),
           text: TAPi18n.__('email-invite-register-text', params, lang),
         })
-      } else if (process.env.MAIL_URL !== '') {
+      } else {
         Email.send({
           to: icode.email,
           from: Accounts.emailTemplates.from,
@@ -355,7 +351,7 @@ if (Meteor.isServer) {
             subject: TAPi18n.__('email-smtp-test-subject', { lng: lang }),
             text: TAPi18n.__('email-smtp-test-text', { lng: lang }),
           })
-        } else if (process.env.MAIL_URL !== '') {
+        } else {
           Email.send({
             to: user.emails[0].address,
             from: Accounts.emailTemplates.from,

+ 1 - 1
models/users.js

@@ -1234,7 +1234,7 @@ if (Meteor.isServer) {
             subject: TAPi18n.__('email-invite-subject', params, lang),
             text: TAPi18n.__('email-invite-text', params, lang),
           })
-        } else if (process.env.MAIL_URL !== '') {
+        } else {
           Email.send({
             to: user.emails[0].address.toLowerCase(),
             from: Accounts.emailTemplates.from,

+ 1 - 1
server/notifications/email.js

@@ -54,7 +54,7 @@ Meteor.startup(() => {
             subject,
             html,
           })
-        } else if (process.env.MAIL_URL !== '') {
+        } else {
           Email.send({
             to: user.emails[0].address.toLowerCase(),
             from: Accounts.emailTemplates.from,

+ 1 - 1
server/rulesHelper.js

@@ -135,7 +135,7 @@ RulesHelper = {
             subject,
             text,
           })
-        } else if (process.env.MAIL_URL !== '') {
+        } else {
           Email.send({
             to,
             from: Accounts.emailTemplates.from,