summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorPierre Kuhner <pkuhner@users.noreply.github.com>2017-08-24 15:23:49 +0200
committerGitHub <noreply@github.com>2017-08-24 15:23:49 +0200
commitc99a950979cb1a6a5e449b31623fbb6a18ad6112 (patch)
treea187e4e370669a7f4f6aa76ee9e76fb2b53ee8e3 /models
parent1b40c42cab9b6dd8b5248af92c7519b5b14cc525 (diff)
downloadwekan-c99a950979cb1a6a5e449b31623fbb6a18ad6112.tar.gz
wekan-c99a950979cb1a6a5e449b31623fbb6a18ad6112.tar.bz2
wekan-c99a950979cb1a6a5e449b31623fbb6a18ad6112.zip
Percent-encode SMTP password to prevent URI malformed errors
Fix URIError: URI malformed errors when sending email with SMTP password containing some special characters. See Sections 2.1 and 3.2 of RFC 3986.
Diffstat (limited to 'models')
-rw-r--r--models/settings.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/settings.js b/models/settings.js
index ce162d45..089c6783 100644
--- a/models/settings.js
+++ b/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;
}