2002-07-06 09:16:23 +02:00
|
|
|
|
|
|
|
sub register {
|
2002-07-08 04:30:11 +02:00
|
|
|
shift->register_hook("quit", "quit_handler");
|
2002-07-06 09:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sub quit_handler {
|
2002-07-08 04:30:11 +02:00
|
|
|
my $qp = shift->qp;
|
2002-09-08 15:23:38 +02: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-07-08 04:30:11 +02:00
|
|
|
my @fortune = `/usr/games/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
|
|
|
}
|