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