On 7/29/2010 8:07 AM, Nikolaos Milas wrote:
  Hello,

I have been setting up a new mail server for our organization
which has different mailservers, one for each subdomain. The
new server, will take over the whole organization using LDAP
and Postfix/Dovecot and things up to now are looking (almost)
nice.

However, I have this problem:

Currently, I have activated the new mailserver (by configuring
our incoming mail gateway which filters for spam/viruses) to
receive mail ONLY for the base domain: *domain.com* AND *NOT
*for the subdomains *a.domain.com, b.domain.com* (but we are
planning to gradually migrate all of the subdomains too, by
simply adding the subdomains to virtual_mailbox_domains
directive and configuring our mail gateway - which is our MX
for the mail domain and all subdomains - to deliver to the new
server rather that to the current mail servers of the
subdomains). But, although I have tried hard and read many
articles, _*I cannot stop Postfix in the new server from
receiving email for the subdomains*_ as well. Of course the
problem occurs *when the mail is leaving from the new
domain.com mail server * - otherwise, when email comes from
our only point of entrance (our antispam-antivirus gateway),
emails reach the correct subdomain servers without problems
(which is natural).

I have even set the "/parent_domain_matches_subdomains =/"
directive to an empty value to avoid receiving for subdomains,
but it didn't solve the issue.

I have come to the conclusion that the problem is caused by
aliases. So, for example, I have defined in LDAP alias tables
(ldap-aliases.cf), that userx (matched by %u) should be
translated to uid userx (found by ldap-users.cf) whose mail is
both: us...@domain.com AND us...@a.domain.com (this has been
done in anticipation of subdomain consolidation to the same
server, where both email addresses will work in parallel and
lead to the same mailbox). So, when I send mail to
us...@a.domain.com, this is matched in aliases tables with
userx which in turn is then matched to us...@domain.com (I can
see in the logs: "to=<us...@domain.com>,
*orig_to*=<us...@a.domain.com>, relay=virtual") and is
delivered locally. Instead, *Postfix Server should have
understood from the very beginning that it is not responsible
for a.domain.com* and should have relayed the email to the MX
of *a.subdomain.com* (whatever it is), *without any processing
whatsoever *(that is, before alias or other processing).

As documented, virtual_alias_maps applies to all mail. If you don't want to process some virtual aliases, don't put them in your table.

  -- Noel Jones

Reply via email to