This section describes, in detail, how Netscape Messaging Server routes messages. After the server accepts a message, it will handle the message by choosing one of the following options:
It is possible for Messaging Server to refuse to accept a message. For example, PreSMTPAccept plug-ins act before SMTP has accepted the incoming message (for information, see Chapter 7, Working with SMTP Plug-Ins). For another example, you can configure the server to refuse messages that exceed a given size (for information, see Chapter 3, Configuring SMTP Services).
To map addresses and route messages, Messaging Server uses information stored as LDAP attributes in Netscape Directory Server. These attributes are described in Table 9.1 and in Table 9.2. In Table 9.1, the addressing attributes determine which LDAP entry handles the address; the routing attributes determine which server handles an LDAP entry. In Table 9.2, the server configuration options determine domain information.
You can set values for the following attributes by using Netscape Console or by using the command-line interface. For information about setting the user attributes, see Chapter 4, Managing Mail Users and Mailing Lists. For information about setting the server attributes, see Chapter 3, Configuring SMTP Services. An exception is the mailRoutingAddress attribute. You can set this attribute only by using Netscape Directory Server tools, such as ldapmodify. For more information about LDAP object classes and setting attributes using LDAP tools, see the Netscape Directory Server Administration Guide and the Netscape Directory Server Schema Reference Manual.
To determine how to route a message, Messaging Server must decide the following:
To make these decisions, the server performs the following steps, which are illustrated in Figure 9.2, and described in detail throughout this chapter.
Qualifies the SMTP Address.
Searches for matching LDAP entries. If no match is found, proceeds to step 3; if exactly one match is found, proceeds to step 4.
Checks to see if the domain is local or remote. If the domain is local, searches for the recipient using the specified search method. If the domain is remote, proceeds to step 5.
Checks routing attributes in LDAP entry.
Routes to remote server.
Figure 9.2 Routing diagram
Step 1: Qualifying the Address
Messaging Server requires standard, fully-qualified SMTP addresses in the RCPT TO: field of the message envelope (for example, joe@airius.com). If an envelope does not have a fully-qualified SMTP address (for example, joe), Messaging Server attempts to make the address standard by adding the domain to the address as follows:
If the service.smtp.defaultdomain attribute has been defined, Messaging Server appends the value defined for this attribute to the envelope address. (For information about specifying this attribute, see Specifying an Address Completion Domain.)
If the service.smtp.defaultdomain attribute has not been defined, Messaging Server appends the value defined for the service.smtp.messagehostname attribute to the envelope address (for example, joe@airius.com).
If the address is of the form joe@server, Messaging Server appends the value defined for its server domain extension (service.smtp.domainname) to the envelope address (for example, joe@server.airius.com).
If the address includes an IP address, such as joe@[198.93.93.10], Messaging Server will perform IP address resolution and replace the IP address with the matching host name (for example, joe@gethost).
Step 2: Searching for matching LDAP Entries
Messaging Server searches for an LDAP entry with a mail or mailAlternateAddress attribute that matches the envelope recipient address. (For information about specifying these attributes, see Specifying User Email Addresses.)
The search includes only LDAP entries that 1) have object class mailRecipient or mailGroup and 2) are in the directory subtree specified by the configured Base DN.
Step 3: Checking if Domain is Local or Remote
If Messaging Server cannot find a matching LDAP entry for an address, it must decide whether the domain specified in the address is local or remote. It considers the address local if the domain part of the address matches:
If the domain is local, Messaging Server assumes the message is addressed to an unknown user and bounces the message.
Otherwise, Messaging Server considers the address to be remote and proceeds to Step 5.
Step 4: Checking Routing Attributes
If Messaging Server finds exactly one LDAP entry that matches the address, it checks the routing attributes for the address and takes the following actions:
For information about how to specify the mailHost attribute, see Specifying User Email Addresses. To set the mailRoutingAddress attribute, you must use Netscape Directory Server tools. For information, see the Netscape Directory Server Administrator's Guide.
Step 5: Routing to Remote Server
If Messaging Server assumes another messaging server is responsible for this recipient, it performs the following steps to route the message to a remote server:
Checks the SMTP routing table
Looks up address of the server in DNS
Checking the SMTP Routing Table
To see if mail for the recipient's domain should be routed to a specific messaging server host, Messaging Server checks its SMTP routing table.
To find an IP address, Messaging Server checks the DNS definition for the domain. See About the Domain Name System (DNS).
Example Routes
This section provides sample routing table entries. For information about how to specify routing table entries using Netscape Console, see Editing SMTP Routing Table Entries.
In the following example, all outgoing mail is routed to bigserver:
*:bigserver.airius.com
The next example routes all mail to subdomains of airius.com through a hub server:
*.airius.com:hub.airius.com
In the next example, messages for any subdomain inside the top-level domain airius.com are sent directly to the mail exchange server for the respective domain:
*.airius.com:*
The next example directs mail for the hub to the server with the specified IP address. Messaging Server need not perform a DNS lookup to find the IP address.
hub.airius.com:[123.345.456.7]
The next example directs all mail sent outside airius.com to a firewall server:
airius.com:*
*.airius.com:*
*:firewall.airius.com
Note: Keep in mind that the server processes entries in the SMTP routing table in order. If, for example, you have a routing entry that sends all non-local mail to a firewall messaging server, you want this entry to be the last entry in the routing table.
Looking Up Address of the Server in DNS
If a routing table entry does not include an IP address in brackets, Messaging Server must know the IP address of the host machine to which it is sending. To find the IP address, Messaging Server uses the Domain Name System (DNS) as follows. For more information on DNS and DNS records, see About the Domain Name System (DNS).
Asks for Mail Exchange Records (MX records) defined for the domain. If MX records are found, tries to route the message to each messaging server defined in the MX records until routing is successful. The MX record must have an associated Address record (A record) that includes the IP address. (Note that Messaging Server caches MX records to decrease the number of DNS lookups required.)
If no MX record is found, asks for the A record for the domain. If the A record is found, routes the message to the host specified for the domain.
If Messaging Server cannot find an IP address for the machine to which it is routing a message, the message is considered undeliverable and Messaging Server bounces the message.