mail to root, local only

Troy Bowman troy at dublan.net
Tue Aug 15 22:54:58 MDT 2006


Wade Preston Shearer wrote:
>> It might be helpful to know what MTA you're using so that we don't have
>> to telnet in and discover for ourselves.
> 
> Sorry, I assumed that that was irrelevant. I assumed it was a standard 
> unix thing; such as with the aliases file.
> 
> I am using sendmail.

Hmm, no one replied to this.  I guess everyone is truly scared of 
Sendmail?  Hah.  I read this list once every few weeks.  Sorry for a 
delay in response.

It should be as simple as taking the smtp MAILER directive out of your 
.mc file and rebuild your .cf.  If you want to start a .mc from scratch, 
you could do something like this:

local-only.mc, cut/paste
---8<--------
divert(-1)
divert(0)dnl
dnl # your m4 file (this is where gentoo keeps it)
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
dnl # host type
OSTYPE(linux)dnl
DOMAIN(generic)dnl
dnl # listen on localhost only
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl # undefine the alias file
undefine(`ALIAS_FILE')
dnl # define local only
MAILER(local)dnl
---8<--------

Then, you just run:

# m4 local-only.mc > sendmail.cf

(sendmail.cf usually goes in /etc/mail)

Then, restart sendmail.


I tested this, and local delivery worked, while I indeed got a bounce 
for my normal (and quite valid) address, for example:

---8<--------
The original message was received at Tue, 15 Aug 2006 22:33:40 -0600
from root at localhost

    ----- The following addresses had permanent fatal errors -----
troy at dublan.net
     (reason: 553 5.1.2 <troy at dublan.net>... Unrecognized host name 
dublan.net.)
     (expanded from: troy at dublan.net)

    ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
 >>> DATA
<<< 553 5.1.2 <troy at dublan.net>... Unrecognized host name dublan.net.
550 5.1.1 troy at dublan.net... User unknown
<<< 503 5.0.0 Need RCPT (recipient)
---8<--------



../troy



More information about the PLUG mailing list