fix: removed invalid options for the sendmail transport (#8576)

* Removed invalid options for the sendmail transport that were causing Nodemailer to return the SMTPTransport instead.

* Removed options for rate limiting in admin email interface. Added new option for toggling whether to use pooled connections.
v1.18.x
Kyle Farris 4 years ago committed by GitHub
parent 6e805c1be7
commit 2b785628e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,8 +110,7 @@
"maximumInvites": 0, "maximumInvites": 0,
"username:disableEdit": 0, "username:disableEdit": 0,
"email:disableEdit": 0, "email:disableEdit": 0,
"email:sendmail:rateLimit": 2, "email:smtpTransport:pool": false,
"email:sendmail:rateDelta": 1000,
"hideFullname": 0, "hideFullname": 0,
"hideEmail": 0, "hideEmail": 0,
"allowGuestHandles": 0, "allowGuestHandles": 0,

@ -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.", "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": "From Name",
"from-help": "The from name to display in the email.", "from-help": "The from name to display in the email.",
"sendmail-rate-limit": "Send <em>X</em> emails...",
"sendmail-rate-delta": "... every <em>X</em> 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": "SMTP Transport",
"smtp-transport.enabled": "Use an external email server to send emails", "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.", "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": "Username",
"smtp-transport.username-help": "<b>For the Gmail service,</b> enter the full email address here, especially if you are using a Google Apps managed domain.", "smtp-transport.username-help": "<b>For the Gmail service,</b> enter the full email address here, especially if you are using a Google Apps managed domain.",
"smtp-transport.password": "Password", "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": "Edit Email Template",
"template.select": "Select Email Template", "template.select": "Select Email Template",

@ -25,9 +25,6 @@ Emailer.transports = {
sendmail: nodemailer.createTransport({ sendmail: nodemailer.createTransport({
sendmail: true, sendmail: true,
newline: 'unix', newline: 'unix',
pool: true,
rateLimit: meta.config['email:sendmail:rateLimit'],
rateDelta: meta.config['email:sendmail:rateDelta'],
}), }),
smtp: undefined, smtp: undefined,
}; };
@ -66,7 +63,9 @@ Emailer.setupFallbackTransport = function (config) {
winston.verbose('[emailer] Setting up SMTP fallback transport'); winston.verbose('[emailer] Setting up SMTP fallback transport');
// Enable Gmail transport if enabled in ACP // Enable Gmail transport if enabled in ACP
if (parseInt(config['email:smtpTransport:enabled'], 10) === 1) { 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']) { if (config['email:smtpTransport:user'] || config['email:smtpTransport:pass']) {
smtpOptions.auth = { smtpOptions.auth = {

@ -18,19 +18,6 @@
</p> </p>
<input type="text" class="form-control input-lg" id="email:from_name" data-field="email:from_name" placeholder="NodeBB" /><br /> <input type="text" class="form-control input-lg" id="email:from_name" data-field="email:from_name" placeholder="NodeBB" /><br />
</div> </div>
<div class="row">
<div class="form-group col-sm-6">
<label for="email:sendmail:rateLimit">[[admin/settings/email:sendmail-rate-limit]]</label>
<input type="number" data-field="email:sendmail:rateLimit" id="email:sendmail:rateLimit" class="form-control" placeholder="2" />
</div>
<div class="form-group col-sm-6">
<label for="email:sendmail:rateDelta">[[admin/settings/email:sendmail-rate-delta]]</label>
<input type="number" data-field="email:sendmail:rateDelta" id="email:sendmail:rateDelta" class="form-control" placeholder="1000" />
</div>
<p class="col-xs-12 help-block">
[[admin/settings/email:sendmail-rate-help]]
</p>
</div>
</form> </form>
</div> </div>
</div> </div>
@ -50,6 +37,17 @@
<span class="mdl-switch__label">[[admin/settings/email:smtp-transport.enabled]]</span> <span class="mdl-switch__label">[[admin/settings/email:smtp-transport.enabled]]</span>
</label> </label>
</div> </div>
<div class="form-group">
<div class="checkbox">
<label for="email:smtpTransport:pool" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" id="email:smtpTransport:pool" data-field="email:smtpTransport:pool" name="email:smtpTransport:pool" />
<span class="mdl-switch__label">[[admin/settings/email:smtp-transport.pool]]</span>
</label>
</div>
<p class="col-xs-12 help-block">
[[admin/settings/email:smtp-transport.pool-help]]
</p>
</div>
<div class="form-group"> <div class="form-group">
<label for="email:smtpTransport:service"><strong>[[admin/settings/email:smtp-transport.service]]</strong></label> <label for="email:smtpTransport:service"><strong>[[admin/settings/email:smtp-transport.service]]</strong></label>
<select class="form-control input-lg" id="email:smtpTransport:service" data-field="email:smtpTransport:service"> <select class="form-control input-lg" id="email:smtpTransport:service" data-field="email:smtpTransport:service">

Loading…
Cancel
Save