7.3 Predefined Macros
The
sendmail
program internally defines many macros for you.
You have already seen
To watch the processing of all the macro definitions,
run
sendmail
once again. This time, add a
% The output that is produced is surprisingly long, considering the small size of the client.cf file:
define(* as $*) define(+ as $+) define(- as $-) define(= as $=) define(~ as $~) define(# as $#) define(@ as $@) define(: as $:) define(> as $>) define(? as $?) define(| as $|) define(. as $.) define([ as $[) define(] as $]) define(( as $() define() as $)) define(& as $&) define(0 as $0) define(1 as $1) define(2 as $2) define(3 as $3) define(4 as $4) define(5 as $5) define(6 as $6) define(7 as $7) define(8 as $8) define(9 as $9)
This output will differ from version to version. For example,
This output demonstrates another concept. Some internal macros
are defined before the configuration file is read,
so you can change them from inside your
client.cf
file. To change
Dwmyhost.my.domain
Doing this would then cause the text
Note that in the preceding output there were no
definitions for the
Finally, note that proper defaults are set only by V8
sendmail
.
All older versions require you to manually provide defaults for the 7.3.1 The hostnameThe name of your local machine is composed of two parts. The host part is the machine name and never contains a dot (such as here ). The domain part is composed of at least two parts separated from each other by dots (such as us.edu ). The fully qualified name of your local machine is made by specifying the host part, then a dot, and finally the domain part (e.g., here.us.edu ). The machine's name needs to be fully qualified to uniquely identify it worldwide. The name of the local machine also needs to be canonical (official and fully qualified). A machine can have multiple names (such as mailhost or printserver ), of which only one is official. The official name for the local machine can be found by issuing the hostname (1) command:
% The official name, when fully qualified with a domain, is the canonical name of the machine. Any other names are aliases. [3]
To see how
sendmail
interprets your local hostname, enter
the following command, which uses the
% Many things can go wrong here. For example, if you're not on the Internet, you may not have assigned your machine a domain name yet. Or you may be running NIS and have listed only the short name in the hosts.byname map. The important thing to observe in the above output is that sendmail correctly found your short and canonical names:
(short domain name) $w = here short hostname (canonical domain name) $j = here.us.edu fully qualified canonical name (subdomain name) $m = us.edu domain If any are wrong, you need to fix the system problem that led to the error. At the system level, investigate:
If you can't find or don't have permission to fix things at the system level, you can fix them in your client.cf file. Suppose, for example, that the canonical name showed up as the short hostname:
(canonical domain name) $j = here wrong
To fix this, you would need to redefine the
Dj$w.$m # The local official domain name
This defines the canonical (fully qualified official)
name to be the same as the local hostname (
(canonical domain name) $j = here.us.edu correct
In a similar manner you can fix |
|