Mail Administration Guide

D and L-Define Macro

Macros are named with a single character. Although a macro can be defined with any character from the complete ASCII set, use only uppercase letters for macros that you define. However, do not use characters like M, R, L, G, and V that are already used by sendmail. Lowercase letters and special symbols are used internally.

You can define macros in two ways:

The syntax for D macro definitions is:


DXval

where X is a letter defining the macro and val is the value it should have. No spaces are allowed. You can insert macros in most places using the escape sequence $X.

Here are examples of D macro definitions from the configuration file:


DRmailhost
Dmeng.acme.com

The variable R is set to contain the value mailhost and the internal variable m is set to contain the value eng.acme.com.

The m macro defines the mail domain. If it is not defined, the name service domain name is used with the first component stripped. For example, ecd.east.acme.com becomes east.acme.com. An even more flexible way to define the mail domain name is to use an L macro definition, as shown in the following example.

The syntax for an L macro definition is:


LXsearch-key

where X is the name of the macro and search-key is looked up in the sendmailvars database. The value found in the entry located by the search key is assigned to X.

Here is an example of an internal L macro definition from the configuration file:


Lmmaildomain

The variable m is set to the value found in the sendmailvars database using maildomain as the search key. If the entry in the sendmailvars database appears as follows:


maildomain        eng.acme.com

the value of m becomes eng.acme.com.


Note -

sendmail uses the sendmailvars entry in the /etc/nsswitch.conf file to determine the order in which to search the name space and /etc/mail/sendmailvars file.