qpsmtpd/plugins/quit_fortune
Ask Bjørn Hansen f9113eb73a http_config plugin
other minor changes

update STATUS and Changes


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@96 958fd67b-6ff1-0310-b445-bb7760255be9
2002-11-06 06:42:55 +00:00

23 lines
539 B
Plaintext

sub register {
shift->register_hook("quit", "quit_handler");
}
sub quit_handler {
my $qp = shift->qp;
# if she talks EHLO she is probably too sophisticated to enjoy the
# fun, so skip it.
return (DECLINED) if ($qp->connection->hello || '') eq "ehlo";
my $fortune = '/usr/games/fortune';
return DECLINED unless -e $fortune;
# local %ENV = ();
my @fortune = `$fortune -s`;
@fortune = map { chop; s/^/ \/ /; $_ } @fortune;
$qp->respond(221, $qp->config('me') . " closing connection.", @fortune);
return DONE;
}