I built a maillog post processor that looks for 'status=sent' for
realy=.*\.outlook.com and collects to=<.*@(.*)> which is the domain
portion of the email addresses. These domains are placed in a
frequency array and sorted from highest to lowest.  The highest
frequency is hotmail.com as you would expect.  I then create a
transport.regexp file that is used to direct outlook traffic to four
transports.  If a domain has a frequency of more than 250, email
addresses are spread across the available transports (see
transport.regexp below). I run this post processor from crontab every
24 hours creating a new transport.regexp.

main.cf:

sender_dependent_default_transport_maps = randmap:{r235,r236,r237,r238}
transport_maps = regexp:/etc/postfix/transport.regexp

outlook5_destination_concurrency_failed_cohort_limit = 100
outlook5_destination_concurrency_positive_feedback = 1/3
outlook5_destination_concurrency_negative_feedback = 1/8
#
outlook6_destination_concurrency_failed_cohort_limit = 100
outlook6_destination_concurrency_positive_feedback = 1/3
outlook6_destination_concurrency_negative_feedback = 1/8
#
outlook7_destination_concurrency_failed_cohort_limit = 100
outlook7_destination_concurrency_positive_feedback = 1/3
outlook7_destination_concurrency_negative_feedback = 1/8
#
outlook8_destination_concurrency_failed_cohort_limit = 100
outlook8_destination_concurrency_positive_feedback = 1/3
outlook8_destination_concurrency_negative_feedback = 1/8


master.cf (outlook transports use the same ip addresses as the randmap
transports):

outlook5  unix  -       -       n       -       2       smtp
  -o smtp_connection_cache_on_demand=no
  -o smtp_bind_address=xxx.xxx.xxx.235
  -o smtp_helo_name=r235.raystedman.org
  -o syslog_name=outlook5
outlook6  unix  -       -       n       -       2       smtp
  -o smtp_connection_cache_on_demand=no
  -o smtp_bind_address=xxx.xxx.xxx.236
  -o smtp_helo_name=r236.raystedman.org
  -o syslog_name=outlook6
outlook7  unix  -       -       n       -       2       smtp
  -o smtp_connection_cache_on_demand=no
  -o smtp_bind_address=xxx.xxx.xxx.237
  -o smtp_helo_name=r237.raystedman.org
  -o syslog_name=outlook7
outlook8  unix  -       -       n       -       2       smtp
  -o smtp_connection_cache_on_demand=no
  -o smtp_bind_address=xxx.xxx.xxx.238
  -o smtp_helo_name=r238.raystedman.org
  -o syslog_name=outlook8


transport.regexp (output of the maillog post processor):

/[a-f,0-1]@hotmail\.com$/                 outlook5:
/[g-l,2-4]@hotmail\.com$/                 outlook6:
/[m-s,5-6]@hotmail\.com$/                 outlook7:
/[t-z,7-9]@hotmail\.com$/                 outlook8:
/@hotmail\.com$/                          outlook8:
/[a-f,0-1]@outlook\.com$/                 outlook7:
/[g-l,2-4]@outlook\.com$/                 outlook6:
/[m-s,5-6]@outlook\.com$/                 outlook5:
/[t-z,7-9]@outlook\.com$/                 outlook5:
/@outlook\.com$/                          outlook6:
/[a-f,0-1]@msn\.com$/                     outlook7:
/[g-l,2-4]@msn\.com$/                     outlook8:
/[m-s,5-6]@msn\.com$/                     outlook8:
/[t-z,7-9]@msn\.com$/                     outlook7:
/@msn\.com$/                              outlook6:
/@live\.com$/                             outlook5:
/@hotmail\.es$/                           outlook5:
/@hotmail\.co\.uk$/                       outlook6:
/@outlook\.es$/                           outlook7:
/@live\.com\.mx$/                         outlook8:
/@live\.com\.ar$/                         outlook8:
etc. for 422 lines


This design spreads outlook.com traffic across the four transports
uniformly and does not rely on smtpd_recipient_restrictions =
check_recipient_mx_access.  This implements a recommendation by Wietse
with some enhancements.  Thank you!

Here are the stats from this morning:
  * email arrival rate: 250/minute
  * outlook.com email sent: 7,088
  * MaxConnections: 6

Aug 24 01:42:29 mail0.raystedman.org outlook5/smtp[245369]:
6C585C8AD3E: to=<foo...@hotmail.com>,
relay=hotmail-com.olc.protection.outlook.com[104.47.32.33]:25,
delay=0.05, delays=0.01/0/0.03/0.01, dsn=4.7.652, status=deferred
(host hotmail-com.olc.protection.outlook.com[104.47.32.33] said: 451
4.7.652 The mail server [xxx.xxx.xxx.xxx.235] has exceeded the maximum
number of connections. (S3115)
[SN1NAM01FT015.eop-nam01.prod.protection.outlook.com] (in reply to
MAIL FROM command))

The MaxConnections messages we receive are spread across the four
transports -- which is good.

I will continue to monitor this in hopes MaxConnections goes to zero
-- but I do not believe it will.  We are only running 2 processes per
transport.  We also need to increase the email arrival rate to have an
effective email server.  Should we run 1 process per transport? What
additional levers do we have available?

Thanks you, Greg
www.RayStedman.org


Blessings, Greg
www.RayStedman.org


On Sat, Aug 22, 2020 at 1:36 PM Wietse Venema <wie...@porcupine.org> wrote:
>
> Wietse Venema:
> > Greg Sims:
> > > sender_dependent_default_transport_maps = randmap:{r235,r236,r237,r238}
> > >
> > > selects transports at random for delivering email.  Is it possible to
> > > schedule a set of transports using a round-robin discipline? This
> >
> > man 5 tcp_table
> > man 5 socketmap_table
> >
> > and implement a server that responds in round-sobin order.
>
> However, if you want to limit the number of conections for each
> Postfix SMTP client IP address, set the right process limit
> in master.cf for those SMTP clients, and do "postfix reload".
>
>         Wietse

Reply via email to