Multicharacter Names

Beginning with V8.7, macro names can be multicharacter. A multicharacter macro name must always appear inside a curly brace pair.[306] For example:

D{name}text

Here, name is one or more characters that form the macro name. If there are no characters between the curly braces, sendmail prints the following error and names the macro "{ }“:

configfile: line num: Name required for macro/class

A multicharacter macro name can contain only letters, digits, and the underscore character. Each bad character between the curly braces (including spaces) will produce the following error and cause that character to be ignored:

configfile: line num: Invalid macro/class character badchar

In general, your macro names should always begin with an uppercase character. Macro names that begin with lowercase characters are reserved for internal use by sendmail.

If the left curly brace is missing but the right is present, the macro name becomes the first letter following the D and the rest becomes the text:

Dname}text       ← sets $n to ame}text

If the right curly brace is missing but the left is present, the following error is printed, and the macro is not defined:

configfile: line num: Unbalanced { on nametext

For V8.10 and later, the maximum length of a macro name is hardcoded at 25 characters.[307] This cannot be changed with compile-time definitions. If you declare a macro name that (not counting the curly braces) is longer than 25 characters, the following error will be printed and the excess characters ...

Get sendmail, 4th 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.