Results 1 to 3 of 3

Thread: Sendmail split domain/lmtp hack

  1. #1
    Join Date
    Jan 2007
    Location
    Minnesota
    Posts
    719
    Rep Power
    9

    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

  2. #2
    Join Date
    May 2007
    Location
    Salt Lake City, UT
    Posts
    50
    Rep Power
    8

    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?

  3. #3
    Join Date
    May 2007
    Location
    Salt Lake City, UT
    Posts
    50
    Rep Power
    8

    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 09:21 PM. Reason: Included actual server and domain name

Similar Threads

  1. zimbraHideInGAL, Edge MTA, and LDAP
    By daneturner in forum Administrators
    Replies: 4
    Last Post: 01-13-2010, 03:48 PM
  2. Split Domain w/Sendmail
    By psimoneschi in forum Migration
    Replies: 4
    Last Post: 02-09-2007, 06:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •