Roberto Ragusa:
> Hi,
> 
> is there a way to throttle outgoing SMTP by destination IP?

No. The Postfix scheduler does not know about IP addresses. That
is a very fundamental property of the design. It schedules deliveries
in parallel, based on domain names.

Otherwise, if DNS lookups for one domain are slow, all other mail
deliveries would have to wait until Postfix has figured out the IP
addresses for that slow domain.

> My problem is that I send mails to
> - domain1.com
> - domain2.com
> - domain3.com
> which handle mails through
> - mx.domain1.com
> - mx.domain2.com
> - mx.domain3.com
> but when I start contacting them they easily complain with
> "too many concurrent connections" because all the mx hosts
> have been resolved to the same IP (well, IP pool, actually).
> These domains (not under my control) are hosted on a provider
> that has shared SMTP servers for all their customers and
> I do not even have an easy way to enumerate the domains.
> 
> Can I let postfix realize that the connections are not
> independent and that I want a parallelism limit for them?

You could create transport_maps entries based on Postfix logging.
Basically, use transport_maps to direct all hosted domains to a
shared Postfix delivery transport with a low process limit.
All you need is a pattern matcher for each mail hosting provider
that is giving you trouble.

    Jun 17 10:28:54 spike postfix/smtp[81358]: 49n6rQ0RbkzJrNw:
    to=<recipi...@example.org>,
    relay=blah.provider.net[xxxx:xx00:0:1::3]:25, delay=0.44,
    delays=0.13/0.012/0.27/0.024, dsn=2.0.0, status=sent (250 2.0.0
    Ok: queued as 720A333A3B9)

Basically, look at the recipient domain in to= and the mail server
domain in relay=, that should be enough to decide that a recipient
domain is hosted with a known hosting provider.

This could use some autonation.

If you get fancy, you could use one dedicated transport per major
mail hosting provider, with its own process limit.

I would advise against using use transport_maps to override MX lookups.

        Wietse

> Of course I want to keep high parallelism for all the other
> normal domains.
> 
> Thanks.
> 
> -- 
>     Roberto Ragusa    mail at robertoragusa.it
> 

Reply via email to