Subject: Re: 2.0 and local mail
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-userlevel
Date: 03/13/2006 21:53:38
On Mon, Mar 13, 2006 at 01:39:12PM -0500, der Mouse wrote:
> How do I get mail delivered locally on 2.0?  I have a 2.0 machine, set
> up without any attention paid to mail, on which crontab-generated mail
> to root is getting stuck in /var/spool/clientmqueue for reasons I have
> not been able to determine.  (It says "Deferred: Connection refused by
> localhost.DOMAIN", where DOMAIN is `hostname | sed -e 's/^[^.]*\.//'`",
> but I have been totally unable to figure out why it's trying to connect
> to localhost.DOMAIN; all my tests with sendmail -bt have resolved to
> $#local.  And yes, /etc/mailer.conf points to sendmail.  hostname does
> not involve "localhost" in any form.)

This is because sendmail nows runs 2 queues, to avoid running suid:
local mails are put in /var/spool/clientmqueue and sent via SMTP to localhost,
where another sendmail, running with root privs, will handle it and deliver
locally or to another MTA. So you need both sendmail=YES and smmsp=YES in
/etc/rc.conf. With a default config sendmail should only listen on
localhost.
It's still possible to run sendmail suid root and get rid of the network
daemon completely, but I've never done it.
For a nullclient config, just link /etc/mail/sendmail.cf to /etc/mail/submit.cf
and all will work without a local listening daemon, without a suid-root
sendmail.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--