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


Previous Section Next Section

switch

Build sequences based on service switch V8.7 and above

The switch database-map type is used internally by sendmail to create sequence types of database maps based on external service-switch files. The lines inside a service-switch file look like this:

service     how how

as, for example:

aliases   files nis

This line tells sendmail to search for its aliases in files first, and then using NIS.

To illustrate the switch type, consider the need to look up aliases inside rule sets in the same way that sendmail looks up its own aliases. To do this, you would declare a switch database map. For example:

Kali switch aliases

This causes sendmail to search for the service named aliases in the service-switch file. In this example it finds such a line, so for each how that follows the aliases in that line, sendmail creates a new database map with the name ali followed by a dot and the how :[17]

[17] Your switch database-map declaration references the new database maps named ali.files and ali.nis. These must be declared before the switch database map is declared. Note that switch database-map declarations always reference other database-map names!

aliases   files    becomes    ali.files
aliases   nis      becomes    ali.nis

These named database maps are then sequenced for you. Recall that sequence database maps are declared like this:

Kname sequence  map1  map2,...

The name given to the sequence is ali. In our example the following sequence is automatically created for you from your original switch declaration:

Kali sequence ali.files ali.nis

In rule sets, when you look up aliases with the ali database map:

R...        $( ali $1 $)
                 
          the sequence named ali

you will use the sequence named ali that was automatically built for you from a combination of your original switch definition and your service-switch file's aliases line. That is, you declare a switch, but you use a sequence.

    Previous Section Next Section