qpsmtpd/plugins/quit_fortune
Ask Bjørn Hansen ca30545adc r3843@embla: ask | 2006-07-14 01:43:40 -0700
take out "local %ENV" from the quit_fortune plugin (Philip M. Gollucci)


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@655 958fd67b-6ff1-0310-b445-bb7760255be9
2006-07-14 08:43:55 +00:00

17 lines
448 B
Plaintext

sub hook_quit {
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;
my @fortune = `$fortune -s`;
@fortune = map { chop; s/^/ \/ /; $_ } @fortune;
$qp->respond(221, $qp->config('me') . " closing connection.", @fortune);
return DONE;
}