If {MyMacro} was previously undefined, it becomes
defined.
The third rule shows what happens when the argument part (the $@ part) is omitted. The
effect is to undefine the {MyMacro} macro.
Regardless of how you update the value in the macro, an empty string is returned. This can
cause the original workspace to be lost. If you need to preserve the original workspace (or
part of it), consider a variation such as the following:
R$* $: $(store_it_in {MyMacro} $@ $1 $) $1
?†‘
return original workspace
This macro type can also be used as an indirect way to store values into different sendmail
macros. To illustrate, consider the following mini configuration file and its use of $&:
V10
Kput macro
D{Target}{LocalTarget}
Stest
R $* $: $(put $&{Target} $@ $1 $)
This is the Title of the Book, eMatter Edition
Copyright ?© 2007 O??™Reilly & Associates, Inc. All rights reserved.
926 | Chapter 23: The K (Database-Map) Configuration Command
Here, the intention is to store the value (the $@ $1) into the macro whose name is stored in
{Target}. Th eD line initializes that name as {LocalTarget}. To witness this indirect method
in action run this mini configuration file in rule-testing mode:
% /usr/sbin/sendmail -Cdemo.cf -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter
> test foo in local target
test input: foo in local target
test returns:
> ${LocalTarget}
foo in local target
> .
Pages:
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637