zone-eu / zone-mta

📤 Modern outbound MTA cross platform and extendable server application
European Union Public License 1.2
599 stars 96 forks source link

Share load between a mix of IPv4 and IPv6 addresses #307

Closed ghost closed 2 years ago

ghost commented 2 years ago

Is it possible to have a sending pool containing both v4 and v6 addresses that ZoneMTA will share the load between?

My best understanding is that this isn't possible at the moment, and that depending on the value of preferIP6 ZoneMTA will always try to use either v4 or v6 addresses.

A particular issue I'm dealing with at the moment is wanting to warm up a new v6 address, but can only configure ZoneMTA to either send (essentially) all or (essentially) none of the messages via this new address.

louis-lau commented 2 years ago

I don't think that that's currently possible. You could however create a plugin that routes for example 10% of messages to a special IPv6 zone with math.random().

ghost commented 2 years ago

I've gone with a sort-of-solution to my particular problem.

I have a single default pool containing all sending addresses.

Using a second sending zone with recipientDomains and senderDomains set I can start preferentially sending via v6 for a subset of messages, albeit not randomly.

zones: {
    default: {
        preferIPv6: false,
        ignoreIPv6: false,
        pool: 'default'
    },
    six: {
        preferIPv6: true,
        ignoreIPv6: false,
        pool: 'default',
        recipientDomains: ['mycompany.com'],
        senderDomains: ['a-smaller-client.org']
    }
}

I think that the above will result in v6 being used for mail to @mycompany.com, from @a-smaller-client.org, or if a v4 connection fails.