SMM:08-46
Sendmail Installation and Operation Guide
case letters only. Lower case letters and special symbols are used internally. Long names beginning
with a lower case letter or a punctuation character are reserved for use by sendmail, so user-defined
long macro names should begin with an upper case letter.
The syntax for macro definitions is:
Dx val
where x is the name of the macro (which may be a single character or a word in braces) and val is
the value it should have. There should be no spaces given that do not actually belong in the macro
value.
Macros are interpolated using the construct $x, where x is the name of the macro to be inter-
polated. This interpolation is done when the configuration file is read, except in M lines. The spe-
cial construct $&x can be used in R lines to get deferred interpolation.
Conditionals can be specified using the syntax:
$?x text1 $| text2 $.
This interpolates text1 if the macro $x is set and non-null, and text2 otherwise. The "else" ($|)
clause may be omitted.
The following macros are defined and/or used internally by sendmail for interpolation into
argv's for mailers or for other contexts. The ones marked are information passed into sendmail
16
,
the ones marked are information passed both in and out of sendmail, and the unmarked macros are
passed out of sendmail but are not otherwise used internally. These macros are:
$a
The origination date in RFC 822 format. This is extracted from the Date: line.
$b
The current date in RFC 822 format.
$c
The hop count. This is a count of the number of Received: lines plus the value of the -h com-
mand line flag.
$d
The current date in UNIX (ctime) format.
$e (Obsolete; use SmtpGreetingMessage option instead.) The SMTP entry message. This is
printed out when SMTP starts up. The first word must be the $j macro as specified by RFC
821. Defaults to "$j Sendmail $v ready at $b". Commonly redefined to include the configu-
ration version number, e.g., "$j Sendmail $v/$Z ready at $b"
$f
The envelope sender (from) address.
$g
The sender address relative to the recipient. For example, if $f is "foo", $g will be "host!foo",
"foo@host.domain", or whatever is appropriate for the receiving mailer.
$h
The recipient host. This is set in ruleset 0 from the $@ field of a parsed address.
$i
The queue id, e.g., "f344MXxp018717".
$j
The "official" domain name for this site. This is fully qualified if the full qualification can be
found. It must be redefined to be the fully qualified domain name if your system is not con-
figured so that information can find it automatically.
$k
The UUCP node name (from the uname system call).
$l (Obsolete; use UnixFromLine option instead.) The format of the UNIX from line. Unless
you have changed the UNIX mailbox format, you should not change the default, which is
"From $g $d".
$m
The domain part of the gethostname return value. Under normal circumstances, $j is equiv-
alent to $w.$m.
16
As of version 8.6, all of these macros have reasonable defaults. Previous versions required that they be defined.