![]() |
Router |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
When the Router parses an address, it extracts the name of the system the message should be delivered to. It becomes the domain name part of the address. The rest of the address is placed into the local part, i.e. the local part defines the recipient when the message is delivered to the system specified with the domain name. In the examples above, the domain name part is zzzz, while the local part is xxxx@yyyyy.
See the RFC822 and related documents for details on E-mail address formats.
Note: if the local part contains a complex address (i.e. it also contains domain name(s) and a local part), the local part is presented in the '%' notation: local%domain1%domain2. This information can be used for sophisticated aliasing methods.
E-mail address | local part | domain part |
---|---|---|
support@stalker.com | support | stalker.com |
-- routed --> | support | |
<@stalker.com:sales@gamma.com> | sales@gamma.com | stalker.com |
-- routed --> | sales@gamma.com | |
-- routed --> | sales | gamma.com |
For example, your server (mycompany.com) may act as an "Remote POP" mail host relay for some client systems. Each client has its own domain name (client1.com, client2.com, and client3.com), and you have configured your Router to ensure that all messages sent to the client1.com domain will be routed to the Unified Domain-Wide Account client1, etc. But you should also ensure that when a message is sent to the client1.com domain, that message is routed to your server (mycompany.com).
Internet mail routing is controlled with the DNS - Domain Name System. Domain Name Servers contain the information about each domain name. So, when the client registers the client1.com domain name, the client should have an MX (mail exchange) DNS record created and that record should point to your Server domain - mycompany.com.
Open the Router page in the Settings section of the WebAdmin Interface to manage the Routing Table:
| |
|
Each line in the Routing Table is a routing record. A routing record contains the left part, the equals sign (=) and the right part. The semicolon sign (;) can be used to place a comment after the right part of a routing record. A comment line can be added to the Table by inserting a line starting with the semicolon sign.
The Router takes a parsed E-mail address (i.e. the domain and local parts of the address) and uses the Table, scanning its records from top to bottom. If an applicable record is found, it is applied as described below and the modified local and/or domain parts are processed with the Router from the beginning.
A Routing record can contain a Relay-mode prefix: Relay: (can be shorten to R:), NoRelay: (can be shorten to N:), or RelayAll:. See the Protection section for the details. If none of these prefixes is specified, the Relay: prefix is assumed.
A Routing record can contain one of the following operation-type prefixes:
When some address is being processed and the domain name matches a domain name specified in such a record, the domain part is substituted with the right part of the routing record.
A routing path can specify relays.
If mail to several domains should be routed in the same or similar way, you may use the asterisk sign as the wild-card symbol.
Very often this type of routing is used to process all subdomains of the some domain.
The asterisk symbol can be used in the right path, in this case it is substituted with the symbols matching the wildcard symbol in the left part.
In most cases, the wildcard symbol is the first symbol in the domain name, but it is allowed to be used anywhere:
Only one wildcard symbol is allowed in one routing record.
Besides domain-level routing records, routing for domains can be specified using Aliasing records (see below). Records for Unified Domain-Wide Accounts are domain-level routing records, too.
If the left part of a routing record contains an E-mail address in the angle brackets (< and >), the record specifies an alias - a routing rule for a specific address.
When an E-mail address is parsed and the Router scans the Table records, it compares the address domain part with the domain part of all alias records met. If the domain parts match, the Router compares the local part of the address with the local part of the alias record address. The local part of the alias record address can contain a wildcard symbol (*). If both domain and local parts match, the right part of the alias routing record is used as the new address. The Router restarts from the beginning, parsing and processing this new address.
Note: Because the Server Main Domain Name in the parsed address is immediately replaced with an empty string, alias records that should apply to addresses in the Main Domain should not contain any domain part at all.
In the all examples below mycompany.com is the Server Main Domain name.
Note: if there is an alias for the local name xxxx, there is no need to actually create a real xxxx Account on the Server. Additionally, that Account would be useless, since no message will ever be stored in that Account: everything directed to the xxxx name is routed elsewhere.
Note: the Router Alias record:
The right side of an alias record can be any E-mail address.
You can use the wildcard symbol (*) in the local part of the alias records. The same symbol can be used in any part of the right-side address to specify substring substitution.
You can use Router Alias records to reroute mail sent to some of the your Server Secondary Domains. In the following example, the client.com is a local Secondary Domain.
In most cases you do not have to use Router Alias Records: if you need to provide an alternative name for an account in the main domain, use Account Aliases instead. If you need to re-route all mail sent to some name in a local domain to some external address, use Forwarders instead.
Sometimes it is necessary to create an alias for a specific account on a foreign system. For example, all mail sent to some domain should be routed to a specific mail host or to a unified account, but certain accounts in that domain should be routed to accounts on your or other systems.
The wildcard symbol (*) can be used only in the local part of the full account name (i.e. it can be used before the @ sign).
You can use the wildcard feature to host several domains in one CommuniGate Pro Domain creating a unique "address space" for each domain name.
Mail to sales@client5.com address will be stored on your server in the cl5-sales Main Domain account, messages to info@client5.com address will be stored in the cl5-info Main Domain account, while messages to sales@client7.com address will be stored in the cl7-sales Main Domain account.
This method can be used when you do not want to create full-scale CommuniGate Domains for many domains that should host 1-2 accounts.
If the domain name part of an address is ERROR, or if the domain name part is empty, and the local name part is ERROR, the address is rejected without processing, generating the "Blacklisted Address" error report.
If the domain name part of an address is BlackListed, or if the domain name part is empty, and the local name part is BlackListed , the address is rejected without processing, generating the "Blacklisted Address" error report. See the SMTP module description for the details.
If the domain name part is empty, and the local name part is spamtrap, routing stops. Addresses of that type are rejected as the ERROR addresses, but the SMTP module processes them in a special manner. See the Protection section for the details.
If the domain name part ends with the symbols .here, this suffix is removed, and the remaining part of the domain name is used as the name of a local CommuniGate Pro domain. This suffix allows you to avoid routing loops in certain situations.
sales.company.com = sales.company.com.via ; explicitly relay to external host *.company.com = company.com ; all other subdomains are rerouted
You can also specify this routing using IP addresses:
sales.company.com = [192.0.0.1] ; explicitly relay to the IP address *.company.com = company.com ; all other subdomains are rerouted
Note: the addresses sent to the sales.stalker.com domain will be relayed with the domain part removed, i.e. the address <user@sales.stalker.com> will be relayed to sales.stalker.com host as <user>. This may cause troubles if the sales.stalker.com server does not accept addresses without domains. See the next sample for a possible solution.
Note: You can specify just host.com instead of host.com.via here (given there is no other router record for host.com), but in this case mail to user@client1.com will be sent to the host.com as user%client1.com@host.com. By specifying the .via suffix you not only tell the Route to route the address to a relaying module, but you also force that module to send only the local part of the address to the remote host.
Address Processing without the .via suffix | ||
---|---|---|
user @ client1.host | Router converts to | user%client1.host @ relay |
user%client1.host @ relay | Router converts to | user%client1.host @ host.com |
user%client1.host @ host.com | Router stops | no rule for host.com |
user%client1.host @ host.com | Router accepts | for SIP/SMTP host.com host as user%client1.host@host.com |
Address Processing with the .via suffix | ||
user @ client1.host | Router converts to | user%client1.host @ relay |
user%client1.host @ relay | Router converts to | user%client1.host @ host.com.via |
user%client1.host @ host.com.via | Router accepts | for host.com as user@client1.host |
If the domain part of the address contains the .via suffix, the module checks the last domain name part after removing this suffix. If that part is a number, the dot (.) symbol separating this part is changed to the colon (:) symbol:
The Router also checks if the domain part of the address ends with the .relay suffix.
This suffix is removed and the resulting domain name is used as the target host name (after changing
the optional port name separator to the colon sign).
This domain name (after removal of the optional port name and its separator) is added to the local name, using the
@ sign as the separator.
*.sales.company.com = *.sales.company.com.relay ; explicitly relay outside *.company.com = company.com ; all other subdomains are rerouted
For IP addresses enclosed in square brackets, the Router checks if the IP address is assigned to one of this Server Domains. If a secondary Domain is found, the IP address is substituted with that Domain name. If the IP address is the IP address of the server Main Domain, an empty string is placed into the domain name part, and the Router makes the next iteration after parsing the local name part of the address.
If an IP address is not assigned to a local Domain, the Router processes the
[10.34.45.67] domain name as the 10.34.45.67.default_port.via name:
the Router sends the address to the SIP or SMTP module, cutting off the domain part and using it as the host name
to relay to.
Each module looks at the address passed and can:
If a module has modified an address, the Router makes a new iteration, repeating all steps for the new, modified address.
If the Router is called from the Message Enqueuer component, and a module has accepted an address, the message is enqueued to this module for delivery.
Each module is called twice. First, the Router calls each module asking to process "obvious" addresses. On this call the modules process only the addresses that are definitely directed to that module: the SMTP module processes addresses with the domain part ending with .smtp, the LIST module processes the addresses of the exiting mailing lists, etc.
If all modules have ignored an address, the Router calls each module again, asking for a "final" attempt. On that stage, the Local Delivery module processes all addresses directed to local domains, the SMTP module processes all addresses with domain names that have at least one dot, etc.
This two-step method allows several modules to correctly process E-mail addresses without relying to a particular module call order. If each module would process an address in one step, listname@domainname addresses (that look like Local account addresses), would be rejected with the Local Delivery module if it is called before the LIST module, user@accountName.local addresses would be taken with the SMTP module instead of the Local Delivery module, etc.
See the module descriptions for details.
server1 = server1.myorg.org server2 = server2.myorg.org server3 = server3.myorg.org
If you have many servers in your myorg.org "upper level" domain, it becomes impossible to provide Router Table records for all of them. In this case you may want to enable the Add myorg.org to Non-Qualified Domain Names option. If this option is enabled, and an E-mail address cannot be routed using CommuniGate Pro Router Table and Modules, and the domain part of the address does not contain a dot symbol, the specified string (myorg.org) is added to the address domain name (separated with the dot symbol). The address user@someserver will be converted to the user@someserver.myorg.org address and the Router will try to route this new, corrected address.
Note: It is a very bad practice to use non-qualified domain names in E-mail addresses. Enable this option only if you can not enforce a policy that requires your users to specify correct, fully-qualified domain names in E-mail addresses.
If, for example, the abuse and postmaster@maindomain.dom addresses are entered into the All-Domain Aliases table (as shown above), then all messages directed to any abuse@domain.dom address (where domain.com is one of the CommuniGate Pro Domains) are rerouted to the postmaster@maindomain.com.
Note: it is very easy to create routing loops using these records: if you enter
The Cluster-Wide Router Table is processed as an extension of the Server Router Table: the Cluster-Wide Router Table records are checked when no Server Router Table record can be applied.