Header From: addresses and other backwards-pointing addresses and forwards-pointing header addresses receive one additional processing step.9 PMDF uses each address specification with any routing address but less any personal name fields as an index key to a special database called the address reversal database.
The address reversal database must be world readable and is generally
located in the PMDF table directory.
a This database file is built with the PMDF CRDB (OpenVMS)
or pmdf crdb
(UNIX and NT) utility.
If the address is found in the database, the corresponding right hand side from the database is substituted for the address. If the address is not found an attempt is made to locate a mapping table named REVERSE in the mapping file. No substitution is made and rewriting terminates normally if the table does not exist or no entries from the table match.
Note 1:
You do not need to have an address reversal database in order to use a REVERSE mapping. That is, you can use a REVERSE mapping without having an address reversal database. And, of course, the reverse is true: you do not need to have a REVERSE mapping to use an address reversal database.
Note 2:
If you have a compiled configuration, then you must recompile and reinstall your configuration in order for changes to the REVERSE mapping table, (or indeed for any changes to the PMDF mappings file), to take effect.
$Y
; a $N
will discard the result of the
mapping. If the mapping entry specifies $D
in addition to
$Y
, the resulting string will be run through the reversal
database once more, and if a match occurs the template from the
database will replace the mapping result (and hence the address). See
Table 3-4 for a description of additional flags available for the
REVERSE mapping, and Table 5-2 for a list of general mapping table
substitution sequences and metacharacters.
Flags | Description |
---|---|
$Y
|
Use output as new address |
$N
|
Address remains unchanged |
$D
|
Run output through the reversal database |
$A
|
Add pattern as reverse database entry |
$F
|
Add pattern as forward database entry |
Flag comparisons | Description |
$:B
|
Match only header (body) addresses |
$:E
|
Match only envelope addresses |
$:F
|
Match only forward pointing addresses |
$:R
|
Match only backwards pointing addresses |
$:I
|
Match only message-ids |
The reverse
and noreverse
channelh keywords,
and the PMDF options USE_REVERSE_DATABASE and REVERSE_ENVELOPE may be
used to control the specifics of when and how address reversal is
applied. In particular, address reversal will not be applied to
addresses in messages when the destination channel is marked with the
noreverse
keyword. If USE_REVERSE_DATABASE is set to 0,
address reversal will not be used with any channel. The
REVERSE_ENVELOPE option controls whether or not address reversal is
applied to envelope From: addresses as well as message header
addresses. See the descriptions of these options and keywords for
additional information on their effects.
The primary use of address reversal is to substitute a generic address (perhaps an address on a central machine) for addresses on remote, and possibly transitory, systems. Address reversal is a particularly powerful tool when used in conjunction with aliases or the directory channel.
Entries in the address reversal database consist of two e-mail
addresses: the address to match against and the address with which to
replace a match. The database is usually created by preparing a text
file and processing it with the PMDF CRDB (OpenVMS) or pmdf
crdb
(UNIX or NT) utility.
For example, suppose a site wishes to replace all reverse pointing
addresses of the form user@acme.com
with an
address of the form first.last@acme.com
where
first.last
is formed from the first (given) and
last (family) names of the owner of the account USER. This will then
cause the outside world to only see addresses of the form
first.last@acme.com
and never see internal
addresses. A text file reverse.txt
containing lines of the
form
user1@acme.com first1.last1@acme.com user2@acme.com first2.last2@acme.com . . . . . .should then be set up and converted to an address reversal database with the OpenVMS commands,
$ PMDF CRDB reverse.txt PMDF_TABLE:reverse.tmp $ RENAME PMDF_TABLE:reverse.tmp PMDF_REVERSE_DATABASEor the UNIX commands,
# pmdf crdb reverse.txt /pmdf/table/reversedb-tmp # pmdf renamedb /pmdf/table/reversedb-tmp /pmdf/table/reversedbAn 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.
As another example, suppose that the internal addresses at acme.com are actually of the form user@host.acme.com, but, fortunately, the username space is such that user@hosta.acme.com and user@hostb.acme.com specify the same person for all hosts at acme.com. Then, rather than have to enter all possible user and host combinations in the address reversal database, the following, very simple REVERSE mapping may be used in conjunction with the address reversal database:
REVERSE *@*.acme.com $0@acme.com$Y$DThis mapping maps addresses of the form
user@host.acme.com
to
user@acme.com
. The $D
flag causes
the address reversal database to then be consulted. The address
reversal database should contain entries of the form shown in the
previous example.
Additional examples are given in Sections 3.3.2.1 , 3.4 , and 3.6 .
Please note that unless PMDF-DIRSYNC is being used to automatically generate a reverse database, normally a REVERSE mapping or reverse database must be constructed manually. The design and maintenance of such a database is likely to be a very site-specific task. The database, for the most part, may end up being the inverse of the translations imposed by aliases on the local system. This is not a requirement, however, and it may be useful to have the database perform other, nonbijective (i.e., non-invertible), address transformations.
Although there is no address reversal database or mapping table by default, address reversal is activated automatically once such an address reversal database or REVERSE mapping exists. (Note that if you have a compiled PMDF configuration, then you must recompile---and on OpenVMS reinstall---your PMDF configuration in order for changes to the REVERSE mapping to take effect.)
PMDF_TABLE:reverse.dat
. On UNIX
systems, the database is the file pointed to by the PMDF Tailor file
option PMDF_REVERSE_DATABASE, by default
/pmdf/table/reversedb.db
. On NT systems, the database is
the file pointed at by the PMDF_REVERSE_DATABASE Registry entry,
generally C:\pmdf\table\reversedb.db
.