Browse Source

Merge branch 'pkuhner-fix-smtp-uri-malformed' into devel

Percent-encode SMTP password to prevent URI malformed errors.
Thanks to pkuhner ! Closes #1181
Lauri Ojansivu 7 years ago
parent
commit
06644d9c71
2 changed files with 7 additions and 5 deletions
  1. 5 3
      CHANGELOG.md
  2. 2 2
      models/settings.js

+ 5 - 3
CHANGELOG.md

@@ -15,10 +15,12 @@ This release adds the following new features:
 
 and fixes the following bugs:
 
-* [Fix Squeezed tickbox in Card](https://github.com/wekan/wekan/pull/1171).
+* [Fix Squeezed tickbox in Card](https://github.com/wekan/wekan/pull/1171);
+* [Percent-encode SMTP password to prevent URI malformed
+   errors](https://github.com/wekan/wekan/pull/1190).
 
-Thanks to GitHub users andresmanelli, danhawkes, jonasob, kubiko, nztqa
-and xet7 for their contributions.
+Thanks to GitHub users andresmanelli, danhawkes, jonasob, kubiko, nztqa,
+pkuhner and xet7 for their contributions.
 
 # v0.32 2017-07-30 Wekan release
 

+ 2 - 2
models/settings.js

@@ -45,7 +45,7 @@ Settings.helpers({
     if (!this.mailServer.username && !this.mailServer.password) {
       return `${protocol}${this.mailServer.host}:${this.mailServer.port}/`;
     }
-    return `${protocol}${this.mailServer.username}:${this.mailServer.password}@${this.mailServer.host}:${this.mailServer.port}/`;
+    return `${protocol}${this.mailServer.username}:${encodeURIComponent(this.mailServer.password)}@${this.mailServer.host}:${this.mailServer.port}/`;
   },
 });
 Settings.allow({
@@ -84,7 +84,7 @@ if (Meteor.isServer) {
       if (!doc.mailServer.username && !doc.mailServer.password) {
         process.env.MAIL_URL = `${protocol}${doc.mailServer.host}:${doc.mailServer.port}/`;
       } else {
-        process.env.MAIL_URL = `${protocol}${doc.mailServer.username}:${doc.mailServer.password}@${doc.mailServer.host}:${doc.mailServer.port}/`;
+        process.env.MAIL_URL = `${protocol}${doc.mailServer.username}:${encodeURIComponent(doc.mailServer.password)}@${doc.mailServer.host}:${doc.mailServer.port}/`;
       }
       Accounts.emailTemplates.from = doc.mailServer.from;
     }