need to sort by domain before submitting to MTA
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
New
|
Medium
|
Unassigned |
Bug Description
I have a number of (large) lists that have a number of
users at the same domain, but are submitted to the MTA
in chunks of 10 to insure the list performs reasonably.
The users at the same domain end up in different queue
files of my MTA, and spark a large number of SMTP
connections to their SMTP servers that could be
minimized if the <user>@<domain> that is passed to the
MTA is sorted by domain. Then I could have one SMTP
transaction with them that delivers 10 messages.
I'm no python expert, but figure sorting of this type
should be fairly simple, and will reduce the amount my
SMTP server abuses these other SMTP servers, which will
be a good thing(tm), as well as save bandwidth..
[http://
SMTPDirect.py
def domsort(uida, uidb):
## sort by domain
## usage foo.sort(domsort)
i = uida.rfind('@')
if i >= 0:
doma = uida[i+1:]
i = uidb.rfind('@')
if i >= 0:
domb = uidb[i+1:]
return cmp(doma, domb)
}
# Need to sort by domain name. if we split to chunks it
is possible
# some well-known domains will be interspersed as we sort by
# userid by default instead of by domain. (jared mauch)
r.sort(domsort)