mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-05-06 17:30:35 +07:00
node_modules: update (#290)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
20
node_modules/nodemailer/lib/smtp-pool/pool-resource.js
generated
vendored
20
node_modules/nodemailer/lib/smtp-pool/pool-resource.js
generated
vendored
@@ -23,7 +23,7 @@ class PoolResource extends EventEmitter {
|
||||
if (this.options.auth) {
|
||||
switch ((this.options.auth.type || '').toString().toUpperCase()) {
|
||||
case 'OAUTH2': {
|
||||
let oauth2 = new XOAuth2(this.options.auth, this.logger);
|
||||
const oauth2 = new XOAuth2(this.options.auth, this.logger);
|
||||
oauth2.provisionCallback =
|
||||
(this.pool.mailer && this.pool.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;
|
||||
this.auth = {
|
||||
@@ -90,10 +90,7 @@ class PoolResource extends EventEmitter {
|
||||
options.port || ''
|
||||
);
|
||||
|
||||
options = assign(false, options);
|
||||
Object.keys(socketOptions).forEach(key => {
|
||||
options[key] = socketOptions[key];
|
||||
});
|
||||
options = Object.assign(assign(false, options), socketOptions);
|
||||
}
|
||||
|
||||
this.connection = new SMTPConnection(options);
|
||||
@@ -114,12 +111,12 @@ class PoolResource extends EventEmitter {
|
||||
}
|
||||
returned = true;
|
||||
|
||||
let timer = setTimeout(() => {
|
||||
const timer = setTimeout(() => {
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
// still have not returned, this means we have an unexpected connection close
|
||||
let err = new Error('Unexpected socket close');
|
||||
const err = new Error('Unexpected socket close');
|
||||
if (this.connection && this.connection._socket && this.connection._socket.upgrading) {
|
||||
// starttls connection errors
|
||||
err.code = errors.ETLS;
|
||||
@@ -180,10 +177,10 @@ class PoolResource extends EventEmitter {
|
||||
});
|
||||
}
|
||||
|
||||
let envelope = mail.message.getEnvelope();
|
||||
let messageId = mail.message.messageId();
|
||||
const envelope = mail.message.getEnvelope();
|
||||
const messageId = mail.message.messageId();
|
||||
|
||||
let recipients = [].concat(envelope.to || []);
|
||||
const recipients = [].concat(envelope.to || []);
|
||||
if (recipients.length > 3) {
|
||||
recipients.push('...and ' + recipients.splice(2).length + ' more');
|
||||
}
|
||||
@@ -224,9 +221,8 @@ class PoolResource extends EventEmitter {
|
||||
info.messageId = messageId;
|
||||
|
||||
setImmediate(() => {
|
||||
let err;
|
||||
if (this.messages >= this.options.maxMessages) {
|
||||
err = new Error('Resource exhausted');
|
||||
const err = new Error('Resource exhausted');
|
||||
err.code = errors.EMAXLIMIT;
|
||||
this.connection.close();
|
||||
this.emit('error', err);
|
||||
|
||||
Reference in New Issue
Block a user