From: "Mike A. Leonetti" on
I posted here before but here is a continuation (in a different issue)
of what's going on.

All aliases are in LDAP. An e-mail is looked up with virtual_alias_maps
and the username (based on the way webmin has it) and not the user's
e-mail. The username is in the format user-domain.com so of course
postfix recognizes it as a non-domain and appends @$myorigin. The system
then recognizes it as a local user and uses mailbox_command = ... to
deliver it.

But, in the end I would really like to deliver it using lmtp (see the
virtual_transport line) to Zarafa which is its destination, and every
time it tries to deliver it it delivers it as
"username-domain.com(a)mydomain.com" which obviously doesn't exist.

So my question is, is it possible to clean out the @$myorigin or
convince it not to append it so I can then just pass it through LMTP to
Zarafa?

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

append_dot_mydomain = no
readme_directory = no

smtpd_tls_cert_file=/etc/certs/server.crt
smtpd_tls_key_file=/etc/certs/server.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = ender.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = domain.com
relayhost = 10.10.12.247
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mail_owner = postfix
inet_protocols = all
header_checks = regexp:/etc/postfix/header_checks

virtual_transport = lmtp:localhost:2003

virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:1005
virtual_gid_maps = static:1005
virtual_minimum_uid = 100
mailbox_command = /usr/bin/procmail -a "$USER"

virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf

content_filter = mppscan:[127.0.0.1]:10025

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = smtpd
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
check_client_access hash:/etc/postfix/rbl_override,
reject_unauth_destination,
reject_rbl_client sbl-xbl.spamhaus.org,
reject_rbl_client b.barracudacentral.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client dnsbl.sorbs.net
message_size_limit = 52428800


Once again I will be the first to admit that I am wordy and confusing
with the way I write. If I am doing something very wrong or backwards
please don't hesitate to let me know.

Thanks.

--
Mike A. Leonetti
As warm as green tea

From: Victor Duchovni on
On Sat, May 22, 2010 at 01:05:12AM -0400, Mike A. Leonetti wrote:

> I posted here before but here is a continuation (in a different issue)
> of what's going on.
>
> All aliases are in LDAP. An e-mail is looked up with virtual_alias_maps
> and the username (based on the way webmin has it) and not the user's
> e-mail.

User names are NOT email addresses. The virtual alias table translates
input RFC 2821 forward-path addresses, to one or more RFC2821 forward-path
addresses.

Bare user names are understood by Postfix only as a short-hand for a
local email address obviating the need to hard-code @$mydomain in
various tables when the output is a local (as in $mydestination)
address.

If your LDAP table returns bare non-local addresses, fix the table.
If your LMTP server expects bare user-names with no @domain part, it is
a non-compliant LMTP server, since LMTP requires the same address syntax
as SMTP.

> But, in the end I would really like to deliver it using lmtp (see the
> virtual_transport line) to Zarafa which is its destination, and every
> time it tries to deliver it it delivers it as
> "username-domain.com(a)mydomain.com" which obviously doesn't exist.

>
> So my question is, is it possible to clean out the @$myorigin or
> convince it not to append it so I can then just pass it through LMTP to
> Zarafa?

Your configuration is wrong. If Zarafa's LMTP server expects bare
RCPT TO:<user> comands, fix that software, otherwise rewrite to the
domain that this software considers local (to it).

--
Viktor.

P.S. Morgan Stanley is looking for a New York City based, Senior Unix
system/email administrator to architect and sustain our perimeter email
environment. If you are interested, please drop me a note.