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:
+27
@@ -15,6 +15,13 @@ const net = require('net');
|
||||
const dns = require('dns');
|
||||
const crypto = require('crypto');
|
||||
|
||||
/**
|
||||
* Recipients allowed on one message unless the caller sets its own maxRecipients. A backstop
|
||||
* against a runaway or hostile recipient list rather than a delivery policy: RFC 5321 only
|
||||
* asks a server to accept 100, so a real send is bounded far below this.
|
||||
*/
|
||||
const DEFAULT_MAX_RECIPIENTS = 100000;
|
||||
|
||||
/**
|
||||
* Creates an object for exposing the Mail API
|
||||
*
|
||||
@@ -191,6 +198,26 @@ class Mail extends EventEmitter {
|
||||
mail.setPriorityHeaders();
|
||||
mail.setListHeaders();
|
||||
|
||||
const maxRecipients = mail.data.maxRecipients === undefined ? DEFAULT_MAX_RECIPIENTS : mail.data.maxRecipients;
|
||||
const recipientCount = mail.message.getEnvelope().to.length;
|
||||
|
||||
if (maxRecipients && recipientCount > maxRecipients) {
|
||||
const err = new Error(
|
||||
`Message has ${recipientCount} recipients, which is over the ${maxRecipients} allowed by maxRecipients`
|
||||
);
|
||||
err.code = errors.EMAXRECIPIENTS;
|
||||
this.logger.error(
|
||||
{
|
||||
err,
|
||||
tnx: 'transport',
|
||||
action: 'send'
|
||||
},
|
||||
'Send Error: %s',
|
||||
err.message
|
||||
);
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
this._processPlugins('stream', mail, err => {
|
||||
if (err) {
|
||||
this.logger.error(
|
||||
|
||||
Reference in New Issue
Block a user