'NoRecipientAction'' ''''


How to handle no recipients in header V8.7 and later

The header portion of a mail message must contain at least one recipient header. Problems can arise when an MUA produces a message with no recipients or when the only recipients are listed in a Bcc: header line. In the past, sendmail inserted an Apparently-To: header (Apparently-To:) into any message that lacked header recipients. The addresses in the Apparently-To: were gleaned from the envelope.

Beginning with V8.7 sendmail, it is possible to choose how messages without recipients will be handled. This is done with the NoRecipientAction option, which is used like this:

O NoRecipientAction=what           configuration file (V8.7 and later) 
-ONoRecipientAction=what           command line (V8.7 and later) 
define(`confNO_RCPT_ACTION',what)  mc configuration (V8.7 and later) 

The argument what is of type string and must be selected from those shown in Table 24-22. If the what is omitted or if it is other than one of the possibilities shown, the following error is printed, and the option is ignored:

Invalid NoRecipientAction: bad what

If the entire option is omitted, the default becomes none. The default for the mc technique is to omit this option.

The what is case-insensitive (meaning that none and nOnE are both identical).

Table 24-22. NoRecipientAction option keywords





See this section

Add an Apparently-To: header


See this section

Add an empty Bcc: header


See this section

Add a To: header


See this section

Add To: undisclosed-recipients:;


See this section

Pass the message unchanged

The NoRecipientAction option is safe. If it is specified from the command line, sendmail will not relinquish its special privileges.


Add an Apparently-To: header. That is, act like pre-V8.7 sendmail. But note that this choice has been deprecated and should not be used.


Add an empty Bcc: header. This makes the header portion of the mail message legal under RFC2822 but implies that all recipients originally appeared in Bcc: header lines. But be aware that old versions of sendmail will strip all Bcc: headers, so the next site might add an Apparently-To: header and wrongly expose the address.


Add a To: header and fill it out with all the recipients from the envelope. This can be misleading because it can give a false picture of the intended recipients. It can also cause Bcc: header addresses to be mistakenly revealed. This choice might be appropriate in the command line when sendmail is run from an MUA that routinely omits recipient headers.


Add a To: header, but list in it only the address of an empty, but descriptive, mailing list:

To: undisclosed-recipients:;

This is the recommended setting for use in configuration files.


Pass the message unchanged. Currently, this is technically illegal because RFC2822 requires at least one recipient header in every mail message. This choice might be appropriate for naïve sites that kick all mail to a smart host for processing. Note that RFC822 makes this legal.

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command