Subject: Re: Local mail delivery not working on 2.0
To: None <netbsd-help@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 03/02/2005 02:02:45
In article <20050221192340.4670.qmail@web41201.mail.yahoo.com>,
	Gary Thorpe <gathorpe79@yahoo.com> writes:
> 
> I put sendmail=NO and smmsp=YES in /etc/rc.conf (I didn't want 
> a daemon running because I only need local delivery on the machine) 
> but that resulted in mail accumulating in /var/spool/clientmqueue and
> messages in /var/log/mailog looking like:

Right. The "smmsp" sendmail doesn't do local delivery, but only tries
to hand off what's in the client queue to the network daemon sendmail
on "localhost", same as "sendmail -oi -t". It's going to give roughly
the same error that you got on your original submission.

> Ok, so I messed up here: I then commented out both lines for sendmail
> and smmsp in /etc/rc.conf so it should go back to the install default,
> right? So now when I try to test out local delivery:

Unfortunately the default doesn't "just work"...

>>>> MAIL From:<myusername@host.local.noinet>
> 550 5.0.0 Access denied

This is coming from sendmail's tcpwrapper's check.  If you look in
"/var/log/maillog", it should say that. The "deny by default" thing
was done recently, it's contrary to the hosts.allow(5) man page, and
it's annoying, but since it was done in the name of Security, and it
tastes bad, it must be good for you.
 
> So it seems that the daemon refuses to accept mail from the local 
> machine by default. Exactly how am I supposed to get local mail
> working?

Short answer, add a line such as "sendmail: localhost." to
"/etc/hosts.allow".

Note that this will permit you to send mail to anyone in the world,
with your username @ hostname as envelope sender, but not allow you
to receive the bounces on your host.  At the very least, you should
have an MX record pointing to a server that accepts mail for your
host, or you could rewrite the envelope sender domain to a server
that accepts mail for you.  If you really only send mail to local
users, this won't be a problem.

> Why is this necessary at all: in 1.6 no knobs where needed 
> for local mail. also, what can I do about all the backup up messages 
> in /var/spool/clientmqueue? Sendmail seems to ignore them (it looks 
> at /var/spool/mqueue). The manual page for sendmail doesn't mention 
> smmsp or the clientmqueue. Can anyone offer pointers on how to 
> proceed?

I already answered the first question (somewhat)...

After you open the door in "hosts.allow", "/etc/rc.d/smmsp onestart"
will deliver all the messages to the network daemon. I.e, you'll see
them move to "/var/spool/mqueue", and if they're all local users, on
to "/var/mail". (You could also run the submission queue without
starting the queue runner via "sendmail -q -Ac", or list the messages
in the queue via "mailq -Ac".)


Frederick