mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-09 18:04:08 +07:00
node_modules: update (#338)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
e1936242ed
commit
a9c5eb6c35
39 files changed
+799
-388
No files matched your search
+17
-27
@@ -177,31 +177,6 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
connection.close();
|
||||
return callback(err);
|
||||
});
|
||||
connection.once('end', () => {
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
const timer = setTimeout(() => {
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
returned = true;
|
||||
cleanupPerCallAuth();
|
||||
// still have not returned, this means we have an unexpected connection close
|
||||
const err = new Error('Unexpected socket close');
|
||||
if (connection && connection.upgrading) {
|
||||
// starttls connection errors
|
||||
err.code = errors.ETLS;
|
||||
}
|
||||
callback(err);
|
||||
}, 1000);
|
||||
try {
|
||||
timer.unref();
|
||||
}
|
||||
catch (_E) {
|
||||
// Ignore. Happens on envs with non-node timer implementation
|
||||
}
|
||||
});
|
||||
const sendMessage = () => {
|
||||
const envelope = mail.message.getEnvelope();
|
||||
const messageId = mail.message.messageId();
|
||||
@@ -221,6 +196,10 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
messageId
|
||||
}, 'Sending message %s to <%s>', messageId, recipients.join(', '));
|
||||
connection.send(envelope, mail.message.createReadStream(), (err, info) => {
|
||||
if (returned) {
|
||||
// the connection error handler has already reported this send
|
||||
return;
|
||||
}
|
||||
returned = true;
|
||||
cleanupPerCallAuth();
|
||||
connection.close();
|
||||
@@ -247,10 +226,16 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
}
|
||||
});
|
||||
};
|
||||
connection.connect(() => {
|
||||
connection.connect(err => {
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
if (err) {
|
||||
// the server closed the connection before the greeting
|
||||
returned = true;
|
||||
connection.close();
|
||||
return callback(err);
|
||||
}
|
||||
perCallAuth = this.getAuth(mail.data.auth);
|
||||
if (perCallAuth && (connection.allowsAuth || options.forceAuth)) {
|
||||
connection.login(perCallAuth, err => {
|
||||
@@ -332,10 +317,15 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
connection.quit();
|
||||
return done(null, true);
|
||||
};
|
||||
connection.connect(() => {
|
||||
connection.connect(err => {
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
if (err) {
|
||||
returned = true;
|
||||
connection.close();
|
||||
return done(err);
|
||||
}
|
||||
perCallAuth = this.getAuth({});
|
||||
if (perCallAuth && (connection.allowsAuth || options.forceAuth)) {
|
||||
connection.login(perCallAuth, err => {
|
||||
|
||||
Reference in new issue
Block a user