home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


sendmail Desktop Reference

sendmail Desktop ReferenceSearch this book
Previous: 3.7 Classes Chapter 3
Databases
Next: 3.9 The User Database
 

3.8 Databases in Rules

Databases are accessed inside the RHS of rules with the $( and $) operators:


$( 


name key 


$)

This looks up key in the database named name and replaces the entire expression (operators and all) with the value found in the database. If no value is found, the key replaces the expression, unless a $: gives a default:


$( 


name key 


$: 


default 


$)

in which instance the default replaces the entire expression.

Optional replacement text can be appear between the name and the $: (if one) or the $) . Each is of the form " $@ text ":


$( 


name key 


$@


text1 


$@


text2 


$)


$( 


name key 


$@


text1 


$@


text2 


$: 


default 


$)

The first (the $@ text1 ) will replace any literal %1 expressions in the value returned by the database. The second (the $@ text2 ) will replace %2 , and so on. In this scheme, %0 always references the key . But note that not all map classes do this replacement.