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 (Section 15.3).
Recipients can be specified in message headers if a
-t command-line argument is used with
sendmail (-t).
Recipients can be specified with the RCPT TO: command (MaxRecipientsPerMessage).
Recipients can be added using aliasing, (Section 12.1), mailing lists (Section 13.1), and expansion of users'
~/.forward files (Section 13.7).
The MILTER interface (Section 7.6) 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 (Section 7.1.4), 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.)
${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 $&{nrcpts}, not
${nrcpts}).