OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: local_recipient_maps and backup mx

From: Magnus Bäck (magnusdsek.lth.se)
Date: Sun Jul 02 2006 - 15:13:10 CDT


On Wednesday, June 28, 2006 at 11:32 CEST,
     Paco Brufal <pbrufalservitux.es> wrote:

> On jun/28/2006, Magnus Bäck wrote:
>
> Thanks for answer.
>
> > No, don't list $virtual_mailbox_maps or $virtual_alias_maps here.
> > A sane Postfix configuration should never need this.
>
> If I don't list $virtual_mailbox_maps or $virtual_alias_maps, the
> server doesn't accept mails for virtual users:
>
> telnet server.com 25
> >ehlo localhost
> >mail from:<qwdgfqergqergmail.com>
> <250 Ok
> >rcpt to:<pbrufalvirtualdomain.com>
> <550 <pbrufalvirtualdomain.com>: Recipient address rejected: User unknown in local recipient table

That's because your configuration is broken. Postfix is flexible and
allows the rules to be bent somewhat, but you will run into trouble
sooner or later. Unless you're very familiar with the territory, stick
to the mainroads.

[...]

> local_recipient_maps = $alias_maps $virtual_mailbox_maps $virtual_alias_maps

As I said, only a broken configuration needs $virtual_mailbox_maps and
$virtual_alias_maps in local_recipient_maps.

> mailbox_transport =
> message_size_limit = 50000000
> mydestination = $myhostname, $transport_maps

No! Don't ever do this! Never ever list $transport_maps in
mydestination. It will only cause you pain.

[...]

> smtpd_banner = SMTP Server

No, that's bad. If the banner text doesn't contain "ESMTP", remote
servers will stick to HELO instead of EHLO. That's undesirable. If you
don't want to announce you're using Postfix, just remove $mail_name
from the smtpd_banner default value.

[...]

[ Transport table contents ]

> domain |destination
> ----------------------------------------
> virtualdomain.com |virtual:
> domainbackupmx.com |smtp:othermailhost.server.com

And here is the source of your pain. None of these domains are really
local domains, but since you list the transport table in mydestination
they will be configured as local domains.

Follow the Postfix address class taxonomy (cf. ADDRESS_CLASS_README) and
you'll find the recipient validation and all other stuff just falls into
place.

List local domains in mydestination.
List virtual mailbox domains in virtual_mailbox_domains.
List virtual alias domains in virtual_alias_domains.
List relay domains in relay_domains.

Unless you know what you're doing, never disobey these rules.

[...]

--
Magnus Bäck
magnusdsek.lth.se