[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: getting hosts.allow to trigger an email.....



On Fri Oct 04 2002 at 13:30, George Gallen wrote:

> Content-Type: text/html;
> 	charset="iso-8859-1"

Please, not text/html to mailing lists.  Please?

> I'm using the following:
> 
> in.telnetd : 192.168.0.1 : mail -s "192.168.0.1 detected"
> ggallen slackinc com <mailto:ggallen slackinc com>
> 
> If I telnet from 192.168.0.1, I get rejected, not accepted
> If I remove the mail.... portion of the entry, I'm acceped and allowed to
> login, but
>    I don't get an email however.
> 
> I've tried:
> 
>  : mail.....
>  : (mail...)
>  : (mail...) &
> and also used the /bin/mail reference in each of the above
> 
> None of the above seem to work.
> 
> My .deny file has ALL:ALL

It needs more than that.  Try this:

ALL : ALL EXCEPT \
	127.0.0.1 \
	: spawn ( \
/bin/echo -e "\
logs\:\
\n\
TCP Wrappers\:	Connection Refused\n\
By\:		$(uname -n)\n\
date\:		$(date)\n\
hostip\:		%a\n\
hostname\:	%h\n\
process\:	%d (pid %p)\n\
connectfrom\:	%c\n\
source\:	%h %H\n\
port\:		%d\n\
"| /bin/mail -s "Wrappers $(uname -n)\: %d refused for %c" root ) &

Modify as desired/required.  It works well.

> George

Cheers
Tony





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]