Create the access Database

To create the access database, you first create a text file that contains lines of hosts, addresses, and IP addresses paired with keywords and values. After that, you run makemap to create the actual database from the text file. If the text file is named /etc/mail/access, you would build the database like this:

# cd /etc/mail
# makemap hash access < access

The text file itself looks like this:

key          value
        ↑
  whitespace: one or more tabs or spaces

The text file is composed of two columns of information. The lefthand column is the key which is composed of a prefix and an address expression. The prefix depends on the rule set doing the lookup. For some it is Connect: or From:, and for others it is TLS_Srv: or TLS_Clt:. These are described in the sections of this book dealing with the appropriate rule set.

The address expression can be any of the following depending on what the rule set is trying to do:

host.your.domain             ← a hostname
your.domain                  ← a domain name
user@                        ← a username
user@host.another.domain     ← a user address
123.45.67.89                 ← an IPv4 host address
123.45                       ← an IPv4 network (leftmost numbers)
IPv6:2002:c0a8:51d2::23f4    ← an IPv6 host address
IPv6:2002:c0a8:02c7          ← an IPv6 network (leftmost numbers)

Note that for usernames the @ is mandatory. More address expressions can be used than we show here. These are the most common. Others are described under the rule sets that use them.

The righthand column contains the value, which can be keywords or values that determine ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.