Forum OpenACS Q&A: Re: ns_sendmail replacement?

Collapse
Posted by MaineBob OConnor on

    Don wrote: Beyond the issues you raise ns_sendmail is slow as it always builds a socket...

So this is why when I loop thru 15,000 emails to using ns_sendmail that we use so much cpu time... I've taken to using a 1 second delay so that web service performance doesn't suffer.

We use Postfix and really like it better than Qmail. I understand that postfix can be configured to use Qmail type mailboxes. I don't know about the postfix equivelent of qmail-inject.

    Don: It would be quite simple to bulk-mail by plugging into the low-level SMTP code and only opening the socket once while sending everything that needs sending.

Great and I'd like to see this and for now would like to back port it to openacs 3.x until I see a clear path to migrate my current sites to 4.x.

-Bob

Collapse
Posted by Tilmann Singer on
I don't see a problem writing a service contract to send a single mail message. It would consist of a single function that accepts more or less the same arguments as ns_sendmail with a few additional ones, such as from_pretty_name etc.

This would imply creating a package for each implementation, like acs-mail-lite-qmail, acs-mail-lite-ns_sendmail etc., and configuring the implementation to use via the service contract binding UI, right?

I don't see an obvious solution for a service contract that does something like sending several different messages in a row, though, which would be necessary to enable an implementation that e.g. keeps an SMTP socket open in the background. Would it require to add something like a 'handle' that the caller has to open and specify when sending a mail? Or would it be possible to build a function that takes several mails at once as arguments - also as many as 15000? Would this require some upvar trickery, such as in the search service contracts?

What are the arguments against integrating separate transport implementations in acs-mail-lite directly? I guess there won't be more than 5 of them realistically. Initially maybe ns_sendmail, postfix and qmail - would that really be that unmaintainable?