[CLUE-Tech] mail from a box without a mail server

Adam Bultman adamb at glaven.org
Sat Oct 5 18:16:40 MDT 2002


>
> You know, you can run anything at all on the firewall machine and use
> iptables to block access to those services from all IP addresses but your own
> using iptables, sort of like this:
>

Sendmail can send mail without necessarily being a server.  It's *easier*,
but mailx or mail, or whatever, often does enough.  All of my servers mail
me log info hourly (logcheck) and only 3 have mail servers running (out of
about 22 machines).


> iptables -t filter -A INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -j ACCEPT
> iptables -t filter -A INPUT -s 0/0 -d 0/0 -j DENY
> (or DROP)
>
That'll do it.
>
> 1. Mount the other machine with NFS.  Tell cron to send the output of its job to
> ">>/mnt/nfs/var/spool/mail/yourmailbox"

Danger, linux user, danger!  Remember, you need the correct format for
this to happen. As well, I've been warned rather sternly by other admins I
know/have worked with about putting mail on a spool that's mounted via NFS
(Not to mention the drawbacks if you set up the NFS export incorrectly.
But I trust you would do the right thing)



Here's what I say: On the server, do this:


echo "blah" |mail you at server.com

and see ifi t works.  If it doesn't, i.e. mail doesn't work, see about
getting that to work.  The programs "Mail" that is. Otherwise, you could
always just pipe the output to yourself.  Oddly, all of my servers have
had the ability to mail that way out of the box.







-- 
Adam Bultman
adam at glaven.org
[ http://www.glaven.org ]





More information about the clue-tech mailing list