![]() ![]() |
23.2 The K Configuration CommandThe K configuration command is used to associate a symbolic name with a database-map type. The symbolic name will later be used in the RHS of rules. The form of the K command looks like this: Kname type args
The name is the symbolic name, the type is the kind of database map to use, and the args specifies its location and properties. We describe each in turn. 23.2.1 The nameThe name portion of the K configuration command immediately follows the K. Whitespace between the K and the name is optional: K name type args The name must begin with a letter or digit and can contain only letters, digits, and the underscore character: K local_hosts The case of the letters in name does not matter. All names are converted to lowercase before they are stored: K LOCAL_Hosts K local_hosts If you begin a name with a bad character, the following error will be printed and that K line will be ignored: configfile: line num: readcf: config K line: no map name
If a bad character appears in the middle of a name, the part preceding the bad character will be taken as the name, and the part following the bad character will be taken as the type. For example, the name me@home will produce this error: configfile: line num: readcf: map me: class home not available
23.2.2 The typeRecall that the type[2] portion of the K configuration command follows the name:
Kname type args
Note that whitespace between the name and the type can be a joined indented line, which allows commenting and improves readability: Kname # Why this name type # Why this type args # and so on The type declares which sort of database map to use. It must be one of the types listed in Table 23-2.
All of these database-map types are described in Section 23.7 at the end of this chapter. If the type is not one of those listed, or if support for the type was not compiled in, the following error is printed and the K command is ignored: configfile: line num: readcf: map name: class type not available 23.2.3 The argsThe args of the K configuration command follow the symbolic name and type: Kname type args
The args specify (among other things) the location of the database file or the name of a network database map. The args is like a miniature command line, and its general form looks like this: switches file_or_map
The switches are letters prefixed with a - character that modify the use of the database. (We'll discuss them in the next section.) The file_or_map is the location of the database file or the name of a network database map. The file_or_map should exclude the .pag and .dir suffixes for dbm-type files and exclude the .db suffix for hash or btree-type files. A database map is opened for reading when the configuration file is processed. If the file cannot be opened (and the -o is omitted, -o), an appropriate error is printed. The file_or_map should be an absolute pathname of a file (such as /etc/mail/uuhosts) or a literal network database-map name (such as hosts.byname). An nis database-map specification can include a domain: map@domain Relative filenames (names that omit a leading /) are interpreted as relative to the queue directory and should never be used. The database files must live in a safe directory (one whose every component is writable only by root or the user defined by the TrustedUser option, TrustedUser). If the file itself is unsafe or its directory is unsafe, one of several errors will be printed or logged, depending on how you run sendmail. (See the description of the DontBlameSendmail option (DontBlameSendmail) for more information about this safety check.) ![]() |
![]() ![]() |