Thanks for the info all!

In order to KISS, I ended up just changing it to relay everything via
relayhost. This works as expected, remote addresses get relayed and local
addresses get delivered like they are supposed to.

On Fri, Jun 11, 2021 at 3:45 AM Michael Storz <michael.st...@lrz.de> wrote:

> Am 2021-06-10 20:57, schrieb Viktor Dukhovni:
> > On Thu, Jun 10, 2021 at 04:30:11PM +0200, Michael Storz wrote:
> >
> >> The next possibility would be to split the email into emails with
> >> recipients from the same domain. Unfortunately, Postfix (currently)
> >> has
> >> no way of configuring a relay host and specifying that the email
> >> should
> >> be split according to the same recipient domain.
> >
> > A socketmap(5) or tcp_table(5) transport(5) table can map each
> > recipient
> > domain (e.g., some.domain.example) into a common parent with a wildcard
> > A
> > record:
> >
> >     # Domain part of key    # Returned result
> >     some.domain.example     smtp:[some.domain.example.wild.local]:10025
> >
> > [ The code performing this mapping should validate the domain syntax,
> >   returning no result for unexpected input syntax. ]
> >
> > The local nameserver would be authoritative for "wild.local" zone,
> > which
> > apart from any zone apex SOA and NS RRs would have:
> >
> >     *.wild.local. IN A 127.0.0.1
> >
> > In a multi-instance configuration, the input instance could use such
> > a transport table to split the envelope of every message before handing
> > it off to the output instance.
>
> Ah, I see: the mapping triggers the normal domain based splitting for
> emails routed via MX-/A-records and the wildcard A-record simulates the
> relay host. Great idea, a little bit tricky, but it should work. Thanks
> Viktor.
>
> >
> >> The last option is to split the email into single recipient emails.
> >> Then
> >> there is no need to differentiate. You can use either single-instance
> >> or
> >> multi-instance Postfix installations to do this. We use single
> >> instance.
> >> Postfix has the TRANSPORT_destination_recipient_limit option (replace
> >> TRANSPORT with the name of the transport you are using) to split an
> >> email according to the number of recipients. If set to 1, you will
> >> receive single recipient emails.
> >
> > Worth noting that concurrency limits are then applied per-recipient,
> > not
> > per-domain.
>

Reply via email to