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 "foo@example.com" 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 Rewrite addresses of mail to the Zimbra server and deliver it via smtp
dnl Note that rule 0 returns a triple: mailer, host, user
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":

foo:  foo@zimbra.int

Then rebuild the aliases.db file:

# newaliases
Verified Against: Sendmail 8.13, 8.14 Date Created: 9/14/2009
Article ID: https://wiki.zimbra.com/index.php?title=Split_Domain_with_a_Sendmail_Primary Date Modified: 2015-03-24

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search