[Mailman-Users] throttling mailman for a relay smtp server
mark at msapiro.net
Mon Oct 24 23:08:52 CEST 2011
Anne Wainwright wrote:
>in essence this has worked well and I did not exceeded the limits given
>for the smtp connection.
>I retained use of Postfix relaying to the isp's smtp server purely
>because it is going as is. No idea of whether setting
>SMTPHOST = smtp.myisp.com would be what I should do to any advantage
>but since it wasn't broken I didn't fix it.
It would be better if you let Postfix deliver the mail directly rather
than via your ISP, but this would not be possible if your ISP
intercepts port 25 connects. It also will not work well if your
Mailman/Postfix server doesn't have a fixed IP and "full circle" DNS.
I.e., you have to look like a legitimate mail server and not a spambot.
Assuming that direct delivery from Postfix is not viable in your
situation, the next best may be to not patch Mailman and let Postfix
do the throttling. Both the FAQ <http://wiki.list.org/x/j4A9> and
Postfix <http://www.postfix.org/addon.html> suggest policyd
<http://policyd.sourceforge.net/readme.html> for this.
If you are going to use the Mailman throttling patch, there's no point
in going through the local Postfix as at best, Postfix is just a
passthrough, and at worst Postfix will break a message with multiple
recipients in multiple domains into multiple messages, one per domain
or even one per recipient, for delivery to the relay server.
>Now the question of the initial settings for the throttle patch:
>THROTTLE_TIME = 60
>THROTTLE_LIMIT = 20 (since upped nearer to stated limit for 60s)
>so tailing the log I see them leaving in batches of 20. ie 20 messages
>in 60 seconds, no problem
>Our most common local domain is telkomsa.net and when I see one of
>those picked up in the batch of 20 the following messages in that batch
>were all to that domain.
>The setting for
>SMTP_MAX_RCPTS = 50
>Am I right that this would be the max number of telkomsa.net messages
>that could be grouped together to that domain? (I don't know how this
>works but imagine that you can send one message bagged with multiple
>addresses to one domain)
First, the throttle patch overrides SMTP_MAX_RCPTS if SMTP_MAX_RCPTS is
greater than THROTTLE_LIMIT. I.e., the actual maximum number of
recipients (RCPT TO) in a single SMTP (MAIL FROM) transaction is the
smaller of SMTP_MAX_RCPTS and THROTTLE_LIMIT.
Assuming no VERP or personalization, Mailman is sending the messages to
Postfix as single messages with up to the smaller of SMTP_MAX_RCPTS
and THROTTLE_LIMIT recipients per message. I.e., one message bagged
with that many addresses in your terminology.
The recipient list for the individual messages is created as follows.
First, the entire list is split into four groups by top level domain.
One group is all .com addresses, the second is .net and .org, the
third is .edu, .us and .ca and the fourth is all others. Then the
individual message recipients are taken in chunks of up to the limit
in size from the groups. So, one chunk that contains a telkomsa.net
address will probably contain others, but it is Postfix that is doing
the sorting of that chunk by recipient domain.
>Therefore as I understand this, no point in having SMTP_MAX_RCPTS >
>THROTTLE_LIMIT as in the example given the result would be unchanged
>from setting SMTP_MAX_RCPTS = 20
That's correct. Basically, Mailman can't send to more than
THROTTLE_LIMIT recipients in one transaction (message) because that
would violate the throttling condition, so THROTTLE_LIMIT has to
override SMTP_MAX_RCPTS if SMTP_MAX_RCPTS is greater.
Note that if your Postfix log shows that for one chunk, Postfix is
delivering individual messages with one recipient per message, even
when there are multiple recipients in the same domain in that chunk
and you want to continue with Postfix as an intermediate MTA, you
might as well enable VERP (VERP_DELIVERY_INTERVAL = 1) because it
won't cost you extra.
Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
More information about the Mailman-Users