Forum OpenACS Q&A: Response to ns_sendmail stalls out

Posted by Andrew Piskorski on
Stan, a couple things that probably aren't directly related to your problem, but might still be helpful:

One, I recall that ns_sendmail does have some limit on the number of email addresses you can hand it in a single ns_sendmail call. Give it too many addresses, and it will break. Unfortunately I don't remember why it breaks, or what piece of the process was causing it to break. I think I last tangled with that problem more than a year ago, but I assume it still exists. If anybody remember why that problem exists, or if it's been fixed, please chime in.

Two, your use of the phrase "doesn't use the MTA" is confusing.

ns_sendmail is actually implemented by a handful of pretty simple Tcl procedures, and it always sends email by connecting to port 25 and talking to the MTA via SMTP on that port. So ns_sendmail always "uses the MTA". In most cases, ns_sendmail is configured to connect to port 25 on the local box, but you can configure it to try to connect to any MTA in the world, if you want. So it would be more precise to say that ns_sendmail always uses an MTA.

However, ns_sendmail definitely never sends email by calling any of the MTA unix commands, like sendmail or qmail-inject. So ns_sendmail certainly does not use the MTA's unix command-line API in any way.

One interesting question is if there's any reason to prefer using a unix command like qmail-inject over ns_sendmail's more general method of SMTP to localhost on port 25. I know Bernstein's qmail docs discuss how hideously slow the SMTP protocol can be, so for large volumes of email, qmail-inject might be better, but I don't really know. And I'd bet that AOLserver and qmail running on the same box can each churn through a lot of ns_sendmail SMTP traffic on port 25 before the inefficiency of SMTP becomes a problem.