Forum OpenACS Q&A: References to qmail

Collapse
Posted by Richard Hamilton on
I am working through the ecommerce setup and have stumbled upon what looks like the need to install and configure qmail.

Now I already have a working implementation of sendmail. Do I really have to install qmail(?), and if so does anyone know if it will coexist with sendmail. Will ecommerce work with sendmail? Can it be hacked to do so easily?
Many Thanks
Richard
Collapse
2: Re: References to qmail (response to 1)
Posted by Joel Aufrecht on
A semi-informed reply:

Qmail and sendmail can exist on the same system, and the qmail install instructions walk you through first installing qmail, then gradually migrating from sendmail to qmail.

ecommerce/tcl/qmail-procs.tcl requires qmail-inject.  In general, this is not necessary for outgoing mail with qmail, because qmail provides a sendmail lookalike.  Other parts of OpenACS, such as acs-mail-lite, use that.  Does anyone know why ecommerce uses qmail-inject?

Your options:
1) Install qmail; don't do any of the migration steps.  It should work.
2) Modify the qmail-procs.tcl commands to look more like

    ns_sendmail $to_addr $from_addr $subject $body $eh $bcc\

and less like

    set qmail_pipe [open "| /var/qmail/bin/qmail-inject -h -f$from" "w"]
    puts -nonewline $qmail_pipe $msg
    close $qmail_pipe

Collapse
3: Re: References to qmail (response to 2)
Posted by Bart Teeuwisse on
Richard,

Joel is right in his assesment. To answer his question, why does eCommerce use qmail? Only aD would know. My I'm guessing because they wanted a faster mailing solution. And probably because the rest of ACS also used qmail.

In OpenACS 4.x the eCommerce dependency on qmail is the exception to the rule and is slated to be removed. Moreover, qmail includes a replacement for sendmail which calls qmail-inject. As ns_sendmail calls sendmail, with the sendmail  replacement in place the message will be send by qmail-inject after all.

/Bart

Collapse
4: Re: References to qmail (response to 1)
Posted by Andrew Piskorski on
At least some of the folks doing sysadmin work at aD had a long-standing (and likely correct) belief that Sendmail was insecure, un-configurable junk, and that Qmail was by far the best replacement available. (I think Philip even had that in his book.)

Except for one ancient Post.Office (some commercial product) instance (which was serving all the arsdigita.com email for far, far too long), which I think was also finally replaced with Qmail, all the servers that I was ever aware of at aD were using Qmail as their MTA, as far as I knew.

There are other alternatives to Sendmail now (Exim, Postfix, Courier, etc.), but I don't think those were at all viable back then, and I'm really not sure how well they all compare vs. Qmail now. Certainly it's still a matter of debate - do a search here and you should see various old posts arguing both for and against Qmail and other DJB tools.

Collapse
5: Re: References to qmail (response to 1)
Posted by Richard Hamilton on
RedHat 8.0 which is what I am using has postfix installed disguised as sendmail and configured to emulate sendmail. I only allow outgoing email which should help security wise.

So I am hoping that I will be able to modify the .tcl pages quite easily to use sendmail.tcl. Do you think that that is a realistic hope?

Richard
Collapse
6: Re: References to qmail (response to 1)
Posted by Richard Hamilton on
Thankfully there are only 2 procs with qmail in their names(!) one is called qmail and seems to be used extensively. I have modified this proc to use sendmail and all seems rosy.

However the other proc that I have found is called qmail_send_compete_message and appears to send a fully formed message without doing any string surgery. Trouble is I can't find any occasions where this is called (which might be good news). There is a reference to it in the webmail docs and the ecommerce docs but it seems that it is never called. Can anyone confirm or deny my suspicion.

Regards
Richard
Collapse
7: Re: References to qmail (response to 6)
Posted by Bart Teeuwisse on
Richard,

I just verified that qmail_send_complete_message is never used. You can safely ignore this proc.

/Bart

Collapse
8: Re: References to qmail (response to 1)
Posted by Richard Hamilton on
Thanks Bart - that's great.
Richard.
Collapse
9: Re: References to qmail (response to 4)
Posted by Joel Aufrecht on
I agree that sendmail (even the rewritten sendmail 9) has an apparently warranted reputation for insecurity.  The weird thing is why someone wrote an app that calls qmail directly.  The sendmail command seems to be the de facto standard API for sending mail, because the other mails can and do emulate it.  So the Right Way appears to be to call ns_sendmail and let it call sendmail and let your MTA of choice simulate sendmail.  And if I understand correctly, that's the decision the community has made?
Personally, I find that the djb tools exemplify unix: powerful, stable, and user-hostile.  Or rather, administrator-hostile.  They tend to fail silently and without explanation, which may (maybe?) be appropriate in some circumstances but makes them brutally unforgiving of mistakes or even just faulty assumptions while installing.
Collapse
Posted by Andrew Piskorski on
There are probably very good performance reasons for calling qmail-inject directly if you're trying to push out a large amount of email. For bulk mailings to your tens of thousands of users, for example. I know at least a few ArsDigita sites had a serious requirement for that (away.com, probably others), and back in the ACS 3.x days there was serious but incomplete work done on a high-performance, Qmail specific Bulkmail package.

ns_sendmail is a quite simple Tcl proc, and has a deserved reputation for slowness. Joel, it does not call the ns_sendmail unix command, it connects to a port (usually localhost) and does a real SMTP transfer. Look at the ns_sendmail code and see for yourself. SMTP is slow to begin with, and ns_sendmail, being a low level but quite simple implementation, is much, much slower than SMTP has to be. It also isn't very featurefull.

Currently, Mat Kovach seems to be driving development of an OpenACS replacement for ns_sendmail, based on Tilmann Singer's acs-mail-lite work. See e.g. these threads: Dec. 2002, Feb. 2003