> Right. And the reason is that answer to my question above: hosts.allow and
> hosts.deny are used by the tcpd program. tcpd is invoked by inetd and is
> configured via the /etc/inetd.conf file. For example on one of my machines
> here is the POP3 entry in /etc/inetd.conf:
>
> pop3 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/popa3d
>
> Note that tcpd is invoked, which checks the hosts.allow/hosts.deny and either
> allows access by invoking popa3d or denies it.
>
> But it only works if tcpd is invoked.
>
> So now here the second question: What happens when you have a service that
> doesn't use inetd, and therefore doesn't invoke tcpd?
>
> Well you've seen your answer from the behavior above. sendmail runs all the
> time, owns port 25, and is not invoked by inetd. So the hosts.allow and
> hosts.deny files are never checked.
>
> >
> > I just don't understand how I can explicitly deny access, and it works
> > for some things but SMTP works great.
>
> See above. Now how to solve the problem. You need another tool that operates
> at the kernel level: packet filtering. And the tools for doing this have
> evolved over the years. 2.2 kernels used IPChains, 2.4 kernels use IPTables,
> and I'm not sure how in the heck 2.6 kernels do it yet.
>
> Take a read of this HOWTO, then take another crack at it:
>
>
http://www.tldp.org/HOWTO/IPCHAINS-HOWTO.html