Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Migration

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-04-2007, 05:35 AM
Outstanding Member
 
Posts: 708
Default Sendmail split domain/lmtp hack

For various icky reasons, I'm doing the reverse of "Configuring Zimbra as the Primary System" described at Split Domain - ZimbraWiki, with sendmail 8 as the core mail router.

The sendmail 8 box also happens to run Cyrus IMAP.

Both Cyrus and Zimbra believe that they are authoritative for @carleton.edu. Cyrus knows of all accounts, and Zimbra has a zimbraMailCatchAllAddress set, I do imapsync etc. migrations to user@phony.carleton.edu, and then zmprov renameAccount user@phony.carleton.edu user@carleton.edu and fiddle the alias tables when the time comes for migration.

For LMTP delivery to Zimbra, I am using this mailer, borrowed from oryx.com:

Code:
PUSHDIVERT(-1)
#
# This mailer uses LMTP to deliver mail to Zimbra on mail.carleton.edu. See
# http://www.oryx.com/mailstore/sendmail.html for information about
# this.
#
_DEFIFNOT(`MAILSTORE_LMTP_ADDRESS',`[mail.carleton.edu]')
_DEFIFNOT(`MAILSTORE_LMTP_PORT',`7025')
_DEFIFNOT(`_DEF_MAILSTORE_MAILER_FLAGS', `FDklmsXz8')
_DEFIFNOT(`MAILSTORE_MAILER_FLAGS', `:|/')
dnl
ifdef(`MAILSTORE_MAILER_ARGS',, `define(`MAILSTORE_MAILER_ARGS', `TCP 'MAILSTORE
_LMTP_ADDRESS` 'MAILSTORE_LMTP_PORT)')
define(`_MAILSTORE_QGRP', `ifelse(defn(`MAILSTORE_MAILER_QGRP'),`',`', `Q=MAILST
ORE_MAILER_QGRP,')')dnl

POPDIVERT

###############################################
###      Zimbra Mailstore Specification     ###
###############################################

Mzimbra,        P=[IPC],
                F=_MODMF_(_DEF_MAILSTORE_MAILER_FLAGS, `MAILSTORE'),
                S=EnvToSMTP/HdrToSMTP, R=EnvToSMTP/HdrToSMTP,
                A=MAILSTORE_MAILER_ARGS, _MAILSTORE_QGRP
                E=\r\n, T=dns/rfc822/smtp, r=512
I have mail.carleton.edu defined in /etc/mail/local-host-names, but otherwise, the name is not used for mail routing. I could/should probably have used a non-DNS internal mail routing address like user@carleton.edu.zimbra.int but making it a lucent address like user@mail.carleton.edu is helpful for testing.

I am using this in sendmail.mc to deliver email forwarded or virtusertabled to user@mail.carleton.edu to user@carleton.edu on the Zimbra machine via LMTP:

Code:
define(`confLOCAL_MAILER', `cyrus')dnl
MAILER(zimbra)dnl
LOCAL_RULE_0
R$+ <@mail.carleton.edu.>      $#zimbra $: $1 <@carleton.edu>
Rbb + $+ < @ $=w . >            $#cyrus $: + $1
Reply With Quote
  #2 (permalink)  
Old 08-21-2007, 12:04 PM
Senior Member
 
Posts: 50
Default

This sounds exactly like what I'm trying to do right now with a few differences. We're using sendmail and dovecot, with procmail doing the actual delivery into the user's maildir. Could you (or somebody) help me fill in the blanks here where I'm not quite understanding things, please?

So, first I would create a new mailer file in /usr/share/sendmail-cf/mailer and name it zimbra.m4, defining the zimbra server as the LMTP address.

Code:
PUSHDIVERT(-1)
#
# This mailer uses LMTP to deliver mail to Zimbra
# on zimbraserver.mydomain.com.
# See http://www.oryx.com/mailstore/sendmail.html
# for information about this.
#
_DEFIFNOT(`MAILSTORE_LMTP_ADDRESS',`[zimbrasever.mydomain.com]')
_DEFIFNOT(`MAILSTORE_LMTP_PORT',`7025')
_DEFIFNOT(`_DEF_MAILSTORE_MAILER_FLAGS', `FDklmsXz8')
_DEFIFNOT(`MAILSTORE_MAILER_FLAGS', `:|/')
dnl
ifdef(`MAILSTORE_MAILER_ARGS',, `define(`MAILSTORE_MAILER_ARGS', `TCP 'MAILSTORE
_LMTP_ADDRESS` 'MAILSTORE_LMTP_PORT)')
define(`_MAILSTORE_QGRP', `ifelse(defn(`MAILSTORE_MAILER_QGRP'),`',`', `Q=MAILST
ORE_MAILER_QGRP,')')dnl

POPDIVERT

###############################################
###      Zimbra Mailstore Specification     ###
###############################################

Mzimbra,        P=[IPC],
                F=_MODMF_(_DEF_MAILSTORE_MAILER_FLAGS, `MAILSTORE'),
                S=EnvToSMTP/HdrToSMTP, R=EnvToSMTP/HdrToSMTP,
                A=MAILSTORE_MAILER_ARGS, _MAILSTORE_QGRP
                E=\r\n, T=dns/rfc822/smtp, r=512
Then, I would add some code to the /etc/mail/sendmail.mc file. I'm not sure how to change the example listed to my environment, but my best guess would be:

Code:
define(`confLOCAL_MAILER', `procmail')dnl
MAILER(zimbra)dnl
LOCAL_RULE_0
R$+ <@zimbraserver.mydomain.com.>      $#zimbra $: $1 <@mydomain.com>
Rbb + $+ < @ $=w . >            $#procmail $: + $1
Does that look right?
Reply With Quote
  #3 (permalink)  
Old 08-22-2007, 08:38 AM
Senior Member
 
Posts: 50
Default

Ended up doing this in the sendmail.mc file:

Code:
MAILER(zimbra)dnl
LOCAL_RULE_0
R$+ <@zimbraserver.mydomain.com.>  $#zimbra $: $1 <@mydomain.com>
Seems to be working.

Last edited by dstoliker; 08-23-2007 at 10:21 PM.. Reason: Included actual server and domain name
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.