home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

21.1 Preassigned sendmail Macros

When sendmail first begins to run, it preassigns values to certain sendmail macros. The complete list of these macros is shown in Table 21-1. Each is described in detail at the end of this chapter, in Section 21.9.

Table 21-1. Preassigned macros

Macro

§

Description

$b

$b

The current date in RFC822 format

${deliveryMode}

${deliveryMode}

The current delivery mode (V8.9 and above)

$j

$j

The canonical hostname

$k

$k

UUCP node name (V8.1 and above)

${load_avg}

${load_avg}

The current load average (V8.10 and above)

$m

$m

The domain name (V8.1 and above)

$n

$n

The bounced mail sender

${opMode}

${opMode}

The startup operating mode (V8.7 and above)

$v

$v

The sendmail program's version

$w

$w

The short name of this host

All preassigned sendmail macros can be redefined in the configuration file or in the command line. The -d35.9 (-d35.9) debugging switch (when run on an empty configuration file) can be used to watch sendmail predefine its macros.[2]

[2] When you use this debugging switch, you will notice that operators such as $* are implemented as macros too.

Note that the mc configuration technique uses many more macros than are shown here (see Table 21-5). But even with that technique this short list of macros is all that are internally defined by the sendmail program when it first starts up.

Also note that many more macros are defined while sendmail sends and receives messages, and processes its queue (see Section 21.9 for a list of all macros).

21.1.1 Macros and the System Identity

The nature of email addresses requires that sendmail have a firm understanding of the machine on which it is running. The -d0.4 debugging switch (-d0.4) causes sendmail to print its understanding of what the local machine is. A portion of that output displays the value of four key sendmail macros:

=  ==  ==  ==  ==  ==  = SYSTEM IDENTITY (after readcf) =  ==  =
      (short domain name) $w = here
  (canonical domain name) $j = here.our.domain
         (subdomain name) $m = our.domain
              (node name) $k = here
=  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  ==  =

The short domain name (in $w; see $w) is simply the name of the local host without any domain information added as a suffix. The canonical domain name (in $j; see $j) is the fully qualified and official name of the local machine. The subdomain name (in $m; see $m) is just the domain part of the canonical name without a leading dot. And the node name (in $k; see $k) is the UUCP name of the local machine.

In addition to these macros, sendmail initializes the class $=w with a list of alternative names for the local host ($=w) and class $=m with a list of the local domains ($=m).

    Previous Section Next Section