The postalias program differs from the postmap program only in the format of the input files (see "Postfix lookup tables (index files)").
postalias 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 postalias supports the hash and btree formats for index files.
postalias |
[ -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
This example is based on the alias file from the example on "Postfix lookup tables (index files)".
You generate the associated index file (hash type) with the following command /etc/postfix/aliases.db:
postalias hash:/etc/postfix/aliases
The command
postalias -q postmaster /etc/postfix/aliases
then supplies the following output for the key “postmaster”: sysroot
The following command deletes the entry with the key “sysroot” in the index file //etc/postfix/aliases.db:
postalias -d sysroot /etc/postfix/aliases
Note that the original text file /etc/postfix/aliases is not changed.