This marvel is
accomplished using the macro-type database map. It is an internal type, always available
regardless of how sendmail was compiled.
The macro type can be used in three ways. For example:
Kstore_it_in macro
R$* $: $(store_it_in {MyMacro} $@ $1 $) ?†? store new value into macro
R$* $: $(store_it_in {MyMacro} $@ $) ?†? clear macro to empty string
R$* $: $(store_it_in {MyMacro} $) ?†? undefine the macro
The first line declares store_it_in to be the name of a macro database-map type that is used
in the rules that follow. Those three rules show three different ways to affect the value
stored in the macro {MyMacro}. Note that the macro name must not be prefixed with a $. If
it is, its value will be used as the name, instead of its actual name. We cover the use of $&
later.
The first rule shows that the value to be stored into the macro is passed as the first $@ argument,
the $1. If this value is that of an undefined macro, the stored result is an empty
string. Otherwise, the value is stored as is into the {MyMacro} macro. If the value contains
macro-like expressions (suchas $x), their values are used. If {MyMacro} was previously
undefined, it becomes defined.
The second rule shows what happens when the value to be stored is missing (or
undefined). A missing value has the effect of clearing the value stored in the {MyMacro}
macro to that of an empty string.
Pages:
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636