${nrcpts}
Number of envelope recipients V8.9 and later
The recipients of an email message can be specified or added to the message in several ways:
Recipients can be specified as part of sendmail’s command line (List of Recipient Addresses on page 226).
Recipients can be specified in message headers if a
-t
command-line argument is used with sendmail (-t on page 248).Recipients can be specified with the
RCPT To:
command (MaxRecipientsPerMessage on page 1050).Recipients can be added using aliasing (The aliases(5) File on page 460), mailing lists (Internal Mailing Lists on page 485), and expansion of users’ ~/.forward files (The User’s ~/.forward File on page 500).
The MILTER interface (Create Milter Support on page 1170) can add and remove recipients as a result of policy decisions.
As each recipient is added to the internal list of
recipients, sendmail updates the ${nrcpts}
macro to
reflect the current count.
The ${nrcpts}
macro
can be useful in the check_compat
rule set (The check_compat Rule Set
on page 259) which is called just before delivery.
The value in ${nrcpts}
can be used to check the
number of recipients, and to possibly refuse
delivery if there are too many recipients. (See also
the MaxRecipientsPerMessage
option, MaxRecipientsPerMessage on page
1050.)
${nrcpts}
is
transient. If it is defined in the configuration
file or in the command line, that definition can be
ignored by sendmail. Note that
a $&
prefix
is necessary when you reference this macro in rules
(that is, use
Get sendmail, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.