On Tue, Nov 29, 2022 at 09:59:47AM -0500, Wietse Venema wrote:
> In /etc/postfix/master.cf:
> ==========================
>
> smtp1 unix - - n - - smtp
> -o { smtp_bind_address = 1.2.3.1 }
> -o { smtp_helo_name = helo-for-1.2.3.1 }
>
> smtp2 unix - - n - - smtp
> -o { smtp_bind_address = 1.2.3.2 }
> -o { smtp_helo_name = helo-for-1.2.3.2 }
>
> In /etc/postfix/main.cf:
> ========================
>
> Next an example that supports different warming up ratios for
> different destinations. See "Notes" below for a simpler approach
> when the warming up ratios can be the same for all destinations.
>
> This example uses a nested table, which requires a restriction class.
> smtpd_recipient_restrictions = check_recipient_access
> inline:{
> { gmail.com = class-gmail }
> { yahoo.com = class-yahoo }
> }
> ...other restrictions...
>
> # To get (90%, 10%), specify one filter 9x and the other filter 1x.
> # The order does not matter.
> restriction_classes = class-gmail, class-yahoo
> class-gmail = check_recipient_access randmap:{filter smtp1:, filter smtp2:}
> class-yahoo = check_recipient_access randmap:{filter smtp1:, filter smtp2:}
I didn't suggest approaches based on FILTER because they may not work
correcly with multi-recipient mail, when not all recipients share the
same domain part. "FILTER" is message level, not per-recipient.
Problems would in practice be rare, but perhaps all the harder to
understand and debug if/when they arise.
A semantically sound solution here would be a table that selectively
(and using a random weight) replaces some MX host names with an
alternative relay.
This would be a new feature, to support sending sites that are migrating
existing high volume outbound relays to a new location or upstream IP
provider.
--
Viktor.