diff --git a/install/data/defaults.json b/install/data/defaults.json index 77954100aa..8fd574fb3a 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -110,8 +110,7 @@ "maximumInvites": 0, "username:disableEdit": 0, "email:disableEdit": 0, - "email:sendmail:rateLimit": 2, - "email:sendmail:rateDelta": 1000, + "email:smtpTransport:pool": false, "hideFullname": 0, "hideEmail": 0, "allowGuestHandles": 0, diff --git a/public/language/en-GB/admin/settings/email.json b/public/language/en-GB/admin/settings/email.json index cfdcc04a5b..f6ade9cfc9 100644 --- a/public/language/en-GB/admin/settings/email.json +++ b/public/language/en-GB/admin/settings/email.json @@ -4,10 +4,7 @@ "address-help": "The following email address refers to the email that the recipient will see in the \"From\" and \"Reply To\" fields.", "from": "From Name", "from-help": "The from name to display in the email.", - "sendmail-rate-limit": "Send X emails...", - "sendmail-rate-delta": "... every X milliseconds", - "sendmail-rate-help": "Instructs the NodeBB mailer to limit the number of messages sent at once in order to not overwhelm email receiving services. These options do not apply if SMTP Transport is enabled (below).", - + "smtp-transport": "SMTP Transport", "smtp-transport.enabled": "Use an external email server to send emails", "smtp-transport-help": "You can select from a list of well-known services or enter a custom one.", @@ -25,6 +22,8 @@ "smtp-transport.username": "Username", "smtp-transport.username-help": "For the Gmail service, enter the full email address here, especially if you are using a Google Apps managed domain.", "smtp-transport.password": "Password", + "smtp-transport.pool": "Enable pooled connections", + "smtp-transport.pool-help": "Pooling connections prevents NodeBB from creating a new connection for every email. This option only applies if SMTP Transport is enabled.", "template": "Edit Email Template", "template.select": "Select Email Template", diff --git a/src/emailer.js b/src/emailer.js index 87704e6c7f..d9a13755a7 100644 --- a/src/emailer.js +++ b/src/emailer.js @@ -25,9 +25,6 @@ Emailer.transports = { sendmail: nodemailer.createTransport({ sendmail: true, newline: 'unix', - pool: true, - rateLimit: meta.config['email:sendmail:rateLimit'], - rateDelta: meta.config['email:sendmail:rateDelta'], }), smtp: undefined, }; @@ -66,7 +63,9 @@ Emailer.setupFallbackTransport = function (config) { winston.verbose('[emailer] Setting up SMTP fallback transport'); // Enable Gmail transport if enabled in ACP if (parseInt(config['email:smtpTransport:enabled'], 10) === 1) { - var smtpOptions = {}; + var smtpOptions = { + pool: config['email:smtpTransport:pool'], + }; if (config['email:smtpTransport:user'] || config['email:smtpTransport:pass']) { smtpOptions.auth = { diff --git a/src/views/admin/settings/email.tpl b/src/views/admin/settings/email.tpl index 6cfd8e5a46..1d3c59d597 100644 --- a/src/views/admin/settings/email.tpl +++ b/src/views/admin/settings/email.tpl @@ -18,19 +18,6 @@


-
-
- - -
-
- - -
-

- [[admin/settings/email:sendmail-rate-help]] -

-
@@ -50,6 +37,17 @@ [[admin/settings/email:smtp-transport.enabled]] +
+
+ +
+

+ [[admin/settings/email:smtp-transport.pool-help]] +

+