One of my clients has an application that builds several hundred
customized messages reporting what changed in the past day, and sends
each one to a list of people who have subscribed to it. (This isn't
spam, they complain when they don't get it.)
We currently send the mail by putting all the recipients on the bcc:
line and running /usr/sbin/sendmail -t and feeding it the message
through a pipe. By the time all the messages are done this takes a
while. Is there a faster way to do it? SMTP to 127.0.0.1? LMTP?
We currently send the mail by putting all the recipients on the bcc:
line and running /usr/sbin/sendmail -t and feeding it the message
through a pipe. By the time all the messages are done this takes a
while. Is there a faster way to do it? SMTP to 127.0.0.1? LMTP?
On 05.03.2024 um 21:14 Uhr John Levine wrote:
We currently send the mail by putting all the recipients on the bcc:
line and running /usr/sbin/sendmail -t and feeding it the message
through a pipe. By the time all the messages are done this takes a
while. Is there a faster way to do it? SMTP to 127.0.0.1? LMTP?
Can you find the reason for that?
By the time all the messages are done this takes a while.
Is there a faster way to do it? SMTP to 127.0.0.1? LMTP?
echo ${mail_message_complete_with_envelope_headers_and_ehlo} > /dev/tcp/$smtpsrv/$smtpport
That might fail due to "unauthorized PIPELINING".
Claus Aßmann wrote:
That might fail due to "unauthorized PIPELINING".
My cron scripts and/or sendmail.cf would beg to differ, but my point is
that it is much superior to deliver a message to a running MSA/MTA than spinning up a new copy of sendmail for every message to be delivered.
John Levine wrote:
Is there a faster way to do it? SMTP to 127.0.0.1? LMTP?
First you need to identify the bottleneck(s),
then you can work on solutions.
BTW: did you read the fine documentation?
(hint: "TUNING"...)
So here's a question: I have on the order of 10,000 messages, each
with a dozen or so recipients.
It currently takes about 6 hours on a moderately fast VPS.
Not large, plain text, maybe 10K.
I'll have to check but I believe there's a local cache on the LAN.
It's sending it all to a smarthost so I wouldn't expect a lot of
DNS traffic.
No, it all works, just not terribly fast.
Right. Hey, here's a question: if I injected the mail via SMTP to
127.0.0.1, would that be faster than forking and running sendmail?
Slower? Or am I the first person in sendmail's 35 year history to
ask this question?
On 3/8/24 18:25, John Levine wrote:
So here's a question: I have on the order of 10,000 messages, each
with a dozen or so recipients.
That's quite a few discrete messages.
It currently takes about 6 hours on a moderately fast VPS.
Rough math, that's a little over 2 seconds per message.
On one hand that seems a little slow, but on the other hand, maybe not.
How big are the messages? There's a big difference if it's a few kB of
text vs multiple MB of attachments.
If it's Linux, `iostat -x 1` or `sar` or `nmon` are good candidates.
I don't remember, are there any milters in Sendmail?
What are you using for the DNS server? Is it local to the system or are
you dependent on something across the network. If it's across the
network, how far across the network is it?
Are there any errors in any logs?
I would naively think that Sendmail itself could handle messages quite a
bit faster. But I'm probably thinking about SMTP interface vs command
line forking.
According to Grant Taylor <gtaylor@tnetconsulting.net>:
What are you using for the DNS server? Is it local to the system or are
I'll have to check but I believe there's a local cache on the LAN. It's sending it all to a smarthost so I wouldn't expect a lot of DNS traffic.
According to Claus A.mann <INVALID_NO_CC_REMOVE_IF_YOU_DO_NOT_POST_ml+sendmail(-no-copies-please)@esmtp.org>:
John Levine wrote:
Is there a faster way to do it? SMTP to 127.0.0.1? LMTP?
First you need to identify the bottleneck(s),
then you can work on solutions.
Well, yeah, that's why I was wondering whether running the sendmail program is likely to be slow.
BTW: did you read the fine documentation?
(hint: "TUNING"...)
I did and unless I missed something, it says nothing about injecting
mail via the sendmail command other than the obvious thing that you
want to queue rather than delivering synchronously.
So here's a question: I have on the order of 10,000 messages, each
with a dozen or so recipients. It's currently running the sendmail
command for each one. If I opened a connection to 127.0.0.1 and
did a sequence of MAIL FROM/RCPT TO/DATA, would that be faster? How
about if I did it with N processes in parallel for some modest N? It currently takes about 6 hours on a moderately fast VPS.
If nobody has any idea, OK, but it's hard to believe I'm the first person ever to wonder about this.
(hint: "TUNING"...)
I did and unless I missed something, it says nothing about injecting
I'll have to check but I believe there's a local cache on the LAN. It's
sending it all to a smarthost so I wouldn't expect a lot of DNS traffic.
Seems like a wrong expectation - or did you turn off DNS lookups?
It's explained in the fine documentation mentioned earlier:
* DNS Lookups
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 45:28:21 |
Calls: | 6,710 |
Calls today: | 3 |
Files: | 12,243 |
Messages: | 5,354,235 |
Posted today: | 1 |