mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-06-22 16:55:26 +07:00
node_modules: update (#297)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
+14
-2
@@ -4,6 +4,8 @@ const { spawn } = require('child_process');
|
||||
const packageData = require('../../package.json');
|
||||
const shared = require('../shared');
|
||||
const errors = require('../errors');
|
||||
const LeWindows = require('../mime-node/le-windows');
|
||||
const LeUnix = require('../mime-node/le-unix');
|
||||
|
||||
/**
|
||||
* Generates a Transport object for Sendmail
|
||||
@@ -46,6 +48,8 @@ class SendmailTransport {
|
||||
this.args = options.args;
|
||||
}
|
||||
}
|
||||
|
||||
this.winbreak = ['win', 'windows', 'dos', '\r\n'].includes((options.newline || '').toString().toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +182,15 @@ class SendmailTransport {
|
||||
);
|
||||
|
||||
const sourceStream = mail.message.createReadStream();
|
||||
sourceStream.once('error', err => {
|
||||
let stream = sourceStream;
|
||||
if (this.options.newline) {
|
||||
// apply the transport-level line ending transform; the message-level
|
||||
// `newline` option is handled by MimeNode in createReadStream()
|
||||
stream = sourceStream.pipe(this.winbreak ? new LeWindows() : new LeUnix());
|
||||
sourceStream.once('error', err => stream.emit('error', err));
|
||||
}
|
||||
|
||||
stream.once('error', err => {
|
||||
this.logger.error(
|
||||
{
|
||||
err,
|
||||
@@ -193,7 +205,7 @@ class SendmailTransport {
|
||||
callback(err);
|
||||
});
|
||||
|
||||
sourceStream.pipe(sendmail.stdin);
|
||||
stream.pipe(sendmail.stdin);
|
||||
} else {
|
||||
const err = new Error('sendmail was not found');
|
||||
err.code = errors.ESENDMAIL;
|
||||
|
||||
Reference in New Issue
Block a user