Running a transport action only as a catch-all

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Running a transport action only as a catch-all

Andrew Beverley
Dear all,

Is there a way that I can specify that a transport rule should only be
carried out as a "catch all" for email addresses that are not otherwise
delivered locally?

Normally I would avoid a catch-all for the obvious reasons, but we're
undertaking a migration, and for a short period we want to have the
Postfix server relay to another MX server any messages that it has no
specific action for (and that it would otherwise normally reject).

I realise I could individually specify all the local addresses in the
transport file for local delivery, and have the remainder relayed, but
there are a large number of them maintained in a database, so it's not
a very practicable option.

Thanks,

Andy
Reply | Threaded
Open this post in threaded view
|

Re: Running a transport action only as a catch-all

Wietse Venema
Andrew Beverley:
> Normally I would avoid a catch-all for the obvious reasons, but we're
> undertaking a migration, and for a short period we want to have the
> Postfix server relay to another MX server any messages that it has no
> specific action for (and that it would otherwise normally reject).

I think that's what relay_domains (without relay_recipient_maps)
and reject_unverified_recipient are for. See the gateway examples
in STANDARD_CONFIGURATION_README.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Running a transport action only as a catch-all

Andrew Beverley
On Wed, 10 May 2017 19:26:48 -0400 (EDT) Wietse Venema wrote:
> > Normally I would avoid a catch-all for the obvious reasons, but
> > we're undertaking a migration, and for a short period we want to
> > have the Postfix server relay to another MX server any messages
> > that it has no specific action for (and that it would otherwise
> > normally reject).
>
> I think that's what relay_domains (without relay_recipient_maps)
> and reject_unverified_recipient are for. See the gateway examples
> in STANDARD_CONFIGURATION_README.

Thanks for the quick reply Wietse. I've tried setting relay_domains and
relay_recipient_maps accordingly, but what I failed to mention in my
first email is that the domain in question is a virtual domain. As
such, emails that I would like forwarded (in relay_domains) are being
rejected with "User unknown in virtual alias table".

I've tried adding the domain as "OK" in the access file configured as
check_recipient_access, but that doesn't make any difference:

  smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access,
    reject_unknown_sender_domain, permit_mynetworks,
    reject_unauth_destination,reject_unauth_pipelining

/etc/postfix/access:

  lists.andybev.com      OK


Is there a way that I can get what would normally be a virtual domain
catch-all to be relayed to another host?

Thanks,

Andy

Reply | Threaded
Open this post in threaded view
|

Re: Running a transport action only as a catch-all

Viktor Dukhovni

> On May 11, 2017, at 11:55 AM, Andrew Beverley <[hidden email]> wrote:
>
> I've tried setting relay_domains and
> relay_recipient_maps accordingly, but what I failed to mention in my
> first email is that the domain in question is a virtual domain. As
> such, emails that I would like forwarded (in relay_domains) are being
> rejected with "User unknown in virtual alias table".

Remove the domain from "virtual_alias_domains" and add it to "relay_domains",
then add a suitable transport table entry to route recipients that were not
rewritten to a suitable relay nexthop.

        relay_domains = example.com
        relay_recipient_maps = ... matches any mailboxes you want to accept that
                               ... are not already listed in virtual_alias_maps

        transport:
                example.com smtp:[overthere.example.com]

> Is there a way that I can get what would normally be a virtual domain
> catch-all to be relayed to another host?

See above.  However, not sure what you mean by "catch-all", if you want
some addresses to be handed off, don't use a catch-all to divert them.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Running a transport action only as a catch-all

Andrew Beverley
On Thu, 11 May 2017 12:30:11 -0400 Viktor Dukhovni wrote:

>
> > On May 11, 2017, at 11:55 AM, Andrew Beverley <[hidden email]>
> > wrote:
> >
> > I've tried setting relay_domains and
> > relay_recipient_maps accordingly, but what I failed to mention in my
> > first email is that the domain in question is a virtual domain. As
> > such, emails that I would like forwarded (in relay_domains) are
> > being rejected with "User unknown in virtual alias table".
>
> Remove the domain from "virtual_alias_domains" and add it to
> "relay_domains", then add a suitable transport table entry to route
> recipients that were not rewritten to a suitable relay nexthop.

Perfect, thanks Viktor, that was the solution.

> > Is there a way that I can get what would normally be a virtual
> > domain catch-all to be relayed to another host?
>
> See above.  However, not sure what you mean by "catch-all",

I was just trying to describe the above scenario. The answer you've
given is what I was looking for.

Thanks,

Andy