Previous Section Next Section

ErrorHeader

Set error message header V8.and later

When a notification of a mail error is sent to the sender, the details of the error are taken from the text saved in the xf file (Section 11.2.7). The ErrorHeader option allows you to prepend custom text ahead of that error text.

Custom error text is useful for sites that wish to offer help as part of the error message. For example, one common kind of error message is notification of an unknown user:

----- Transcript of session follows -----
 550 5.7.1 smith@wash.dc.gov... User unknown
----- Unsent message follows -----

Here, the user smith is one that is unknown. A useful error help message for your site to produce might be:

Common problems:
     User unknown: the user or login name is wrong.
     Host unknown: you mistyped the host part of the address.
----- Transcript of session follows -----
 550 5.7.1 smith@wash.dc.gov... User unknown
----- Unsent message follows -----

The forms for the ErrorHeader option are as follows:

O ErrorHeader=text                configuration file (V8.7 and later) 
-OErrorHeader=text                command line (V8.7 and later) 
define(`confERROR_MESSAGE',`text')    mc configuration (V8.7 and later) 
OEtext                            configuration file (V8.6 deprecated) 
-oEtext                           command line (V8.6 deprecated) 

The argument text is mandatory. If it is missing, this option is ignored. The text is either the actual error text that is printed or the name of a file containing that text. If text begins with the / character, it is taken as the absolute pathname of the file (a relative name is not possible). If the specified file cannot be opened for reading, this option is silently ignored.

Macros can be used in the error text, and they are expanded as they are printed. For example, the text might contain:

For help with $u, try "finger $u"

which might produce this error message:

For help with smith@wash.dc.gov, try "finger smith@wash.dc.gov"
   ----- Transcript of session follows -----
550 5.7.1 smith@wash.dc.gov... User unknown
   ----- Unsent message follows -----

If you specify a file, that file must live in a directory that is safe. A directory is safe when all components of its path are writable only by root or the trusted user specified in the TrustedUser option (TrustedUser). If the directory is unsafe, sendmail will ignore the file. If you must put that file in an unsafe directory, you can still enable sendmail to use it by setting the appropriate DontBlameSendmail option (See this section). Note that the file itself must be writable only by root or the trusted user specified in the TrustedUser option, regardless of the directory permissions.

The ErrorHeader option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

    Previous Section Next Section