mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-11-02 07:55:51 +07:00
node_modules: update
This commit is contained in:
10
node_modules/nodemailer/lib/sendmail-transport/index.js
generated
vendored
10
node_modules/nodemailer/lib/sendmail-transport/index.js
generated
vendored
@ -2,8 +2,6 @@
|
||||
|
||||
const spawn = require('child_process').spawn;
|
||||
const packageData = require('../../package.json');
|
||||
const LeWindows = require('./le-windows');
|
||||
const LeUnix = require('./le-unix');
|
||||
const shared = require('../shared');
|
||||
|
||||
/**
|
||||
@ -68,7 +66,6 @@ class SendmailTransport {
|
||||
let args;
|
||||
let sendmail;
|
||||
let returned;
|
||||
let transform;
|
||||
|
||||
const hasInvalidAddresses = []
|
||||
.concat(envelope.from || [])
|
||||
@ -187,10 +184,8 @@ class SendmailTransport {
|
||||
recipients.join(', ')
|
||||
);
|
||||
|
||||
transform = this.winbreak ? new LeWindows() : new LeUnix();
|
||||
let sourceStream = mail.message.createReadStream();
|
||||
|
||||
transform.once('error', err => {
|
||||
sourceStream.once('error', err => {
|
||||
this.logger.error(
|
||||
{
|
||||
err,
|
||||
@ -205,8 +200,7 @@ class SendmailTransport {
|
||||
callback(err);
|
||||
});
|
||||
|
||||
sourceStream.once('error', err => transform.emit('error', err));
|
||||
sourceStream.pipe(transform).pipe(sendmail.stdin);
|
||||
sourceStream.pipe(sendmail.stdin);
|
||||
} else {
|
||||
return callback(new Error('sendmail was not found'));
|
||||
}
|
||||
|
||||
43
node_modules/nodemailer/lib/sendmail-transport/le-unix.js
generated
vendored
43
node_modules/nodemailer/lib/sendmail-transport/le-unix.js
generated
vendored
@ -1,43 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const stream = require('stream');
|
||||
const Transform = stream.Transform;
|
||||
|
||||
/**
|
||||
* Ensures that only <LF> is used for linebreaks
|
||||
*
|
||||
* @param {Object} options Stream options
|
||||
*/
|
||||
class LeWindows extends Transform {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
// init Transform
|
||||
this.options = options || {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes dots
|
||||
*/
|
||||
_transform(chunk, encoding, done) {
|
||||
let buf;
|
||||
let lastPos = 0;
|
||||
|
||||
for (let i = 0, len = chunk.length; i < len; i++) {
|
||||
if (chunk[i] === 0x0d) {
|
||||
// \n
|
||||
buf = chunk.slice(lastPos, i);
|
||||
lastPos = i + 1;
|
||||
this.push(buf);
|
||||
}
|
||||
}
|
||||
if (lastPos && lastPos < chunk.length) {
|
||||
buf = chunk.slice(lastPos);
|
||||
this.push(buf);
|
||||
} else if (!lastPos) {
|
||||
this.push(chunk);
|
||||
}
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LeWindows;
|
||||
52
node_modules/nodemailer/lib/sendmail-transport/le-windows.js
generated
vendored
52
node_modules/nodemailer/lib/sendmail-transport/le-windows.js
generated
vendored
@ -1,52 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const stream = require('stream');
|
||||
const Transform = stream.Transform;
|
||||
|
||||
/**
|
||||
* Ensures that only <CR><LF> sequences are used for linebreaks
|
||||
*
|
||||
* @param {Object} options Stream options
|
||||
*/
|
||||
class LeWindows extends Transform {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
// init Transform
|
||||
this.options = options || {};
|
||||
this.lastByte = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes dots
|
||||
*/
|
||||
_transform(chunk, encoding, done) {
|
||||
let buf;
|
||||
let lastPos = 0;
|
||||
|
||||
for (let i = 0, len = chunk.length; i < len; i++) {
|
||||
if (chunk[i] === 0x0a) {
|
||||
// \n
|
||||
if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {
|
||||
if (i > lastPos) {
|
||||
buf = chunk.slice(lastPos, i);
|
||||
this.push(buf);
|
||||
}
|
||||
this.push(Buffer.from('\r\n'));
|
||||
lastPos = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lastPos && lastPos < chunk.length) {
|
||||
buf = chunk.slice(lastPos);
|
||||
this.push(buf);
|
||||
} else if (!lastPos) {
|
||||
this.push(chunk);
|
||||
}
|
||||
|
||||
this.lastByte = chunk[chunk.length - 1];
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LeWindows;
|
||||
Reference in New Issue
Block a user