How to configure sendmail, so only localhost can send?
After emerging sendmail i first configured it by adding the line
to /etc/mail/sendmail.mc, hoping to allow only localhost to send mails.
After starting sendmail i couldn't send any mails :
Following some advice found on the web, i added the following line to hosts.allow:
aim-nano ~ # sendmail email@example.com
sendmail: Cannot open aim-nano.unizh.ch:25
This didn't change the ability to send mails (still "cannot open...") but
sendmail: localhost : allow
telnet worked over the smtp port:
If however i remove the DAEMON_OPTIONS line from sendmail.mc
aim-nano ~ # telnet localhost smtp
Connected to localhost.
Escape character is '^]'.
220 aim-nano.unizh.ch ESMTP Sendmail 8.14.0/8.14.0; Wed, 12 Sep 2007 12:02:01 +0200
250-aim-nano.unizh.ch Hello localhost [127.0.0.1], pleased to meet you
221 2.0.0 aim-nano.unizh.ch closing connection
Connection closed by foreign host.
and reconfigure, and set
in hosts.allow, i can send mails. But then it seems the port is somehow
sendmail: 22.214.171.124 : allow
open from outside. I can
from another machine and do an "ehlo" (although other commands give me an
telnet aim-nano smtp
"550 5.0.0 Access denied")
Question: is this (sendmail: 126.96.36.199 : allow) a secure setup?
If not, how do i have to configure things to have a secure localhost-sendmail