${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:

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.