2012-04-29 01:35:59 -07:00
|
|
|
#!perl -w
|
2002-07-06 07:16:23 +00:00
|
|
|
|
2005-07-07 04:17:39 +00:00
|
|
|
sub hook_quit {
|
2002-07-08 02:30:11 +00:00
|
|
|
my $qp = shift->qp;
|
2002-09-08 13:23:38 +00:00
|
|
|
|
|
|
|
# if she talks EHLO she is probably too sophisticated to enjoy the
|
|
|
|
# fun, so skip it.
|
|
|
|
return (DECLINED) if ($qp->connection->hello || '') eq "ehlo";
|
|
|
|
|
2002-11-06 06:42:55 +00:00
|
|
|
my $fortune = '/usr/games/fortune';
|
|
|
|
return DECLINED unless -e $fortune;
|
|
|
|
|
|
|
|
my @fortune = `$fortune -s`;
|
2002-07-08 02:30:11 +00:00
|
|
|
@fortune = map { chop; s/^/ \/ /; $_ } @fortune;
|
|
|
|
$qp->respond(221, $qp->config('me') . " closing connection.", @fortune);
|
|
|
|
return DONE;
|
2002-07-06 07:16:23 +00:00
|
|
|
}
|