Postfix uses index files (lookup tables, see "Postfix lookup tables (index files)"). The postmap program offers the following functionality for processing lookup tables:
Generating index files from text files
Displaying entries for a specific key value (index search)
Adding entries to an index file
Removing entries from an index file
The BS2000 ported version of Postfix supports the hash and btree formats for index files.
postmap |
[ -q <key>] [-d <key>] [-i ] [hash:|btree:]<path-name> ... |
-q <key>
Searches the entry for the key value <key> and outputs the first assigned value.
-d <key>
Deletes the entry with the key value <key>.
-i
Reads entries from the standard input and inserts these in the index file <path-name>.db.
hash: | btree:
Specifies the type of index file to be generated (hash
or btree
).
<path-name>
Name of the file for which the associated index file <path-name>.db is to be generated.
Example
A lookup table canonical which maps BS2000 user names (up to 8 characters long) onto email addresses with the format first-name.family-name contains the following entries:
maier Georg.Maier
mueller Elisabeth.Mueller
You generate the associated index file using the following command (hash type) /etc/postfix/canonical.db:
postmap hash:/etc/postfix/canonical
The command
postmap -q maier /etc/postfix/canonical
then supplies the following output for the key “maier” : Georg.Maier
The following command deletes the entry with the key “mueller” in the index file /etc/postfix/canonical.db:
postmap -d mueller /etc/postfix/canonical
Note that the original text file /etc/postfix/canonical is not changed.