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?