Split Domain with a Sendmail Primary
The Split Domain article discusses the details of configuring a Zimbra system to function as either a primary or secondary server in a split domain. This article will discuss a way to configure a Sendmail system to operate as the primary server with Zimbra acting as the secondary. As mentioned in the Split Domain article, it is necessary to perform configuration steps on both the primary and secondary systems for each mail account moved to the secondary.
The technique described here uses an entry for the migrated user in the /etc/aliases file on the Sendmail master that tells Sendmail to address the mail to a fake domain name (zimbra.int). An address rewrite rule (in Sendmail's rule 0) tells Sendmail to deliver mail addressed to "zimbra.int" to the Zimbra host, using SMTP and to change the recipient address domain back to the original.
The following conventions are used in the sample configuration:
- The domain is "example.com".
- The existing Sendmail server is "mail.example.com".
- The Zimbra server is "zimbra.example.com" and has "example.com" configured on it.
- The Zimbra server has been configured as the secondary system as documented in the Split Domain article.
- The user "firstname.lastname@example.org" has been migrated to the Zimbra server.
Sendmail Configuration Changes
Set your default directory to /etc/mail and edit the Sendmail configuration file, "sendmail.mc".
Near the end of the file, above the MAILER() definitions, add:
dnl dnl Rewrite addresses of mail to the Zimbra server and deliver it via smtp dnl dnl Note that rule 0 returns a triple: mailer, host, user dnl LOCAL_RULE_0 R$+ < @ zimbra.int > $# esmtp $@ zimbra.example.com $: $1 < @ example.com >
Note that the Sendmail configuration file syntax requires that there must be one or more <tab> characters between "@ zimbra.int >" and "$# esmtp". All of the other white space in the rule must be <space> characters.
In order to have Sendmail use the configuration changes it is necessary to compile the sendmail.mc file into the sendmail.cf file and then restart the Sendmail daemon.
# make # service sendmail restart
Changes Made For Each Migrated User
For each user migrated to Zimbra, create an entry in the /etc/aliases file that will cause our new rule 0 to route the message to the Zimbra server.
Insert the following for migrated user "foo":
Then rebuild the aliases.db file: