PMDF System Manager's Guide


Previous Contents Index

3.1.2 The Alias Database

PMDF always reads in all the aliases from the alias file and stores them internally in a hash table. This scheme is adequate for most applications where fewer than 500 or so aliases are needed.

However, some systems may want to establish aliases for a majority of their users. For example, a user smith whose real name is Cathy Smith, might want to have Cathy_Smith, Cathy.Smith, and Smith as aliases for her account. Setting up such aliases for each member of a large user population may lead to an excessively large alias file that consumes far too much memory.

PMDF solves this problem by providing an optional facility for storing large numbers of aliases in an ancillary indexed data file. Whenever the alias file is used PMDF also checks for the existence of the PMDF alias database.5 If the alias database exists, it is opened and consulted once for each address on the local channel. The alias database must be world readable.

By default, the mere presence of the alias database is enough to activate this database facility in PMDF; it is not necessary to rebuild or reconfigure PMDF to include it. Use of the alias database can be disabled with the PMDF option USE_ALIAS_DATABASE. This option can also be used to tell PMDF that the alias database is required, and if it isn't there, to return a temporary error (by specifying USE_ALIAS_DATABASE=2).

3.1.2.1 Using Both the Alias File and the Alias Database

The alias database is a supplement to the alias file; it is not a replacement for the alias file. If the alias database exists, PMDF uses both the alias file and the alias database.

The alias database is consulted once each time the regular alias file is consulted. However, the alias database is checked before the regular alias file is used. In effect, the database acts as a sort of address rewriter that is invoked prior to using the regular alias file. Although duplicate entries are allowed in the database, it is undefined as to which of the duplicate entries will be returned when the database is accessed. Database entries are case insensitive.

The fact that limited recursion is allowed in the alias file makes the complete translation mechanism rather complex. For example, suppose that the alias file contains the entries,


A: C,J 
B: D,K 
D: G,H 
E: I 
and the alias database contains the entries,


D: E 
C: B 
F: D 

Now suppose the address A@local-host was presented to PMDF. First A would be looked up in the database --- not found. Then A would be translated into C and J by the alias file. C would in turn be translated into B by the database while J would remain unchanged. B would then be translated into D and K by the alias file. D would then be translated into E by the database while K would remain unchanged. Finally, E would be translated into I by the alias file, and since I does not appear in the database the process would terminate. The final result is that A translates into the list I, J, K.

The easiest way to look at the translation process is to simply follow it step-by-step as illustrated below.


Initial  Data      Data      Data      Data 
look up  base File base File base File base Result 
-------  ---- ---- ---- ---- ---- ---- ---- ------ 
      A     A    C    B    D    E    I    I      I 
                           K    K    .    .      K 
                 J    J    .    .    .    .      J 
      B     B    D    E    I    I    .    .      I 
                 K    K    .    .    .    .      K 
      C     B    D    E    I    I    .    .      I 
                 K    K    .    .    .    .      K 
      D     E    I    I    .    .    .    .      I 
      E     E    I    I    .    .    .    .      I 
      F     D    G    G    .    .    .    .      G 
                 H    H    .    .    .    .      H 

Such complex use of the aliases facility is not encouraged and is presented for illustrative purposes only.

Note

In particular, for most normal goals any particular entry should appear in either the alias file or the alias database, not in both!

3.1.2.2 Format of the Alias Database

The alias database has the same format as the optional domain database file described in Section 2.2.9. This means that aliases in the database are limited to 32 characters in length and can translate to a string containing at most 80 characters unless a "long" database is used. See Section 2.2.9 for information on long databases.

Length restrictions aside, alias database entries are handled in the same way as alias file entries and can be used in exactly the same way. Both multiple addresses and mailing list references are allowed. Both the alias file and alias database must be world readable.

The PMDF alias database is created from an input text file (not from the alias file---from a different input text file) using the PMDF CRDB (OpenVMS) or pmdf crdb (UNIX or NT) utility, described in Chapter 29 and Chapter 30. The format of entries in the input file for CRDB or crdb should be:


alias1   alias-value1
alias2   alias-value2
   .           .
   .           .
   .           .

Note that unlike the aliases file, the entries in the alias database source text file normally do not use a colon to separate the alias from its value.

On OpenVMS systems, the alias database should be generated with the commands:


$ PMDF CRDB input-file-spec PMDF_TABLE:aliases.tmp
$ RENAME PMDF_TABLE:aliases.tmp PMDF_ALIAS_DATABASE
An intermediate, temporary database is used so as to minimize any window of time during which the database file is in an undefined state as it is being generated or regenerated. On UNIX systems, use the commands


# pmdf crdb input-file-spec PMDF_ALIAS_DATABASE
On NT systems, use the commands


C:\ pmdf crdb input-file-spec PMDF_ALIAS_DATABASE

Alternatively, a source file using colons, (that is, of the same format as the alias file), e.g.,


alias1:   alias-value1
alias2:   alias-value2
   .           .
   .           .
   .           .
may be used providing that the /STRIP_COLONS (OpenVMS) or -strip_colons (UNIX or NT) qualifier is used when building the database; e.g., on OpenVMS:


$ PMDF CRDB/STRIP_COLONS input-file-spec PMDF_TABLE:aliases.tmp
$ RENAME PMDF_TABLE:aliases.tmp PMDF_ALIAS_DATABASE
or on UNIX:


# pmdf crdb -strip_colons input-file-spec PMDF_ALIAS_DATABASE
or on NT:


C:\ pmdf crdb -strip_colons input-file-spec PMDF_ALIAS_DATABASE

Note

5 On OpenVMS systems, the logical PMDF_ALIAS_DATABASE points to the alias database, which by default is the file PMDF_TABLE:aliases.dat. On UNIX systems, the PMDF_ALIAS_DATABASE option in the PMDF tailor file points to the the alias database; by default, the file /pmdf/table/aliasesdb.*. On NT systems, the PMDF_ALIAS_DATABASE NT Registry entry points to the alias database, usually the file C:\pmdf\table\aliasesdb.*.


Previous Next Contents Index