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.

  • 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 ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.