Forum OpenACS Q&A: qmail confusion

Posted by Jacques Williams on
I've asked this on ArsDigita, but since it's relevant to OpenACS I'll
ask it here as well (also, I haven't yet gotten an answer on AD :().
In user-add-3.tcl (OpenACS 3.4), when I try to notify a new user that
they've been added, I get a qmail error: "sorry, that domain is not in
my list of rcpthosts". But the domain that is not in rcpthosts is the
_recipient's_ domain! Do I have to run an open mail relay in order to
use this functionality?
Posted by Roberto Mello on
Naveen Agnihotri replied with a fairly detailed explanation to your question... didn't that work? Did you try it? He says that it's all explained in the qmail FAQ and he even posted links to the relative sections.

AFAIK, you have your machine to the relay list. Remember qmail is setup to be secure by default unlike most versions of Sendmail out there.

Take a look at his answer and if it doesn't work let us know.

Posted by Jacques Williams on

My domain is in the rcpthosts file. If I add the recipient's domain to rcpthosts, the error disappears. Hence my question, "do I have to run an open relay to use this functionality".

Thank you for your help.

Posted by Stephen . on
Yes, you have to run an open mail relay to use this functionality, SELECTIVELY! This is what ucspi-tcp is used for, it sets the environment variable that tells qmail to be an open relay, but only when the connection is from, i.e. AOLserver on the local machine. This is configurable.

More instructions: http://Web.InfoAve.Net/~dsill/lwq.html

Posted by Jacques Williams on
Thanks to all who helped me with this. It's quite straightforward once you get used to the idea that you have to run a relay for messages originating from the local domain.
Posted by Glen Stewart on
I had a similar problem with Qmail today, and hacked around it by modifying AOLserver's aolserver/modules/tcl/sendmail.tcl file (and then restarting AOLserver). This change makes AOLserver (and ACS) execute the local sendmail instead of talking SMTP, getting past Qmail's relay situation. Only one proc needed to be changed, and here it is:

proc _ns_sendmail {smtp smtpport timeout tolist bcclist 
	from subject body extraheaders} {
    foreach f {/usr/lib/sendmail /usr/sbin/sendmail} {
      if {[file exists $f]} {
	set Mail(program) $f
    ## Put the tolist in the headers
    set rfcto [join $tolist ", "]
    ## Build headers
    set msg "To: $rfcto
From: $from
Subject: $subject
Date: [ns_httptime [ns_time]]"
    ## Insert extra headers, if any (not for BCC)
    if ![string match "" $extraheaders] {
	set size [ns_set size $extraheaders]
	for {set i 0} {$i < $size} {incr i} {
	    append msg "
[ns_set key $extraheaders $i]: [ns_set value $extraheaders $i]"
    ## Blank line between headers and body
    append msg "

    ## pass message to sendmail
    if { [catch {
        exec $Mail(program) $rfcto << $msg
    } errMsg ] } {
	## Error, close and report
	return -code error "Unable to send mail"