mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-09-09 05:56:37 +07:00
node_modules: update (#314)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
+5
-2
@@ -62,14 +62,17 @@ class SendmailTransport {
|
||||
// Sendmail strips this header line by itself
|
||||
mail.message.keepBcc = true;
|
||||
|
||||
const envelope = mail.data.envelope || mail.message.getEnvelope();
|
||||
const envelope = mail.message.getEnvelope();
|
||||
const messageId = mail.message.messageId();
|
||||
let returned;
|
||||
|
||||
const hasInvalidAddresses = []
|
||||
.concat(envelope.from || [])
|
||||
.concat(envelope.to || [])
|
||||
.some(addr => /^-/.test(addr));
|
||||
// a local part is either a dot-atom or a quoted-string, so a leading dash sits at
|
||||
// offset 0 or, behind the opening quote, at offset 1. Only the first shape is read
|
||||
// as an option by sendmail, but both are the address this guard keeps out of argv
|
||||
.some(addr => /^"?-/.test(addr));
|
||||
if (hasInvalidAddresses) {
|
||||
const err = new Error('Can not send mail. Invalid envelope addresses.');
|
||||
err.code = errors.ESENDMAIL;
|
||||
|
||||
Reference in New Issue
Block a user