Chapter 21. The D (Define a Macro) Configuration Command

The sendmail program supports three flavors of macros: class macros (Chapter 22) are used to represent multiple values; database-map macros (Chapter 23) represent values stored in external files or networked maps; and defined macros represent values stored in the internal symbol table.

Defined macros also come in three flavors. The m4 compile-time macros (Section 3.2) are used when building the sendmail program and its companion programs. The mc configuration macros (Section 4.3) are used when converting an mc file into a sendmail configuration file. In this chapter we discuss the third approach, sendmail macros, which allow strings of text to be represented symbolically inside a sendmail configuration file.

Defined sendmail macros can be declared (given names and assigned the strings of text that will become values) at five different times:

  • When sendmail first begins to run, it preassigns strings of text to certain sendmail macros.

  • When sendmail processes its command line, macros that were declared by using the -M (Section 21.2) command-line switch[1] are assigned their values.

    [1] Prior to V8.7 the -oM option (M) was used to define macros on the command line. Although that option still works, the -M command-line switch is now recommended as the preferred technique.

  • When sendmail reads its configuration file, macros that were declared by using the D configuration-file command (Section 21.3) are assigned their values.

  • Many macros are assigned values internally by sendmail as mail is received and sent.

  • And macros can be given values as part of rule sets using the macro database-map type (macro).

Defined sendmail macros can be used in any configuration-file command. Generally, they are expanded (their value is used) when mail is sent or received.

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command