Sendmail Operation Guide

H: define header

The format of the header lines that sendmail(1M) inserts into the message are defined by the H line. The syntax of this line is one of the following:

Hhname:htemplate
H [?mflags?] hname:htemplate
H [?$/macro/?] hname:htemplate

Continuation lines in this specification are reflected directly into the outgoing message. The htemplate is macro-expanded before insertion into the message. If the mflags (surrounded by question marks) are specified, at least one of the specified flags must be stated in the mailer definition for this header to be automatically output. If a ${macro} (surrounded by question marks) is specified, the header will be automatically output if the macro is set. The macro may be set using any of the normal methods, including using the macro storage map in a ruleset. If one of these headers is in the input it is reflected to the output regardless of these flags or macros.

A secondary syntax allows validation of headers as they are being read. To enable validation, use:

H Header $> Ruleset
H Header $>+ Ruleset

The indicated Ruleset is called for the specified Header and can return $#error to reject the message or $#discard to discard the message (as with the other check_* rulesets). The header is treated as a structured field, that is, comments (in parentheses) are deleted before processing, unless the second form $>+ is used.

For example, the configuration lines:

   HMessage-Id: $>CheckMessageId
   

SCheckMessageId R< $+ @ $+ > $@ OK R$* $#error $: Illegal Message-Id header

would refuse any message that had a Message-Id: header of any of the following forms:

Message-Id: <>
Message-Id: some text
Message-Id: <legal text@domain> blah blah blah

A default ruleset that is called for headers which don't have a
specific ruleset defined for them can be specified by:

H\*(*E> * : $> Ruleset
or
H\*(*E> * : $>+ Ruleset


© 2000 The Santa Cruz Operation, Inc. All rights reserved.