From c1aa3ddb8a9537b45d6ca3a802fc7b867afa07ee Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Wed, 19 Nov 2003 23:01:43 +0000 Subject: [PATCH] Override log function to use fileno(client) as pid will always be the same Don't use exit() in response to bad LF end of DATA git-svn-id: https://svn.perl.org/qpsmtpd/trunk@195 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/SelectServer.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd/SelectServer.pm b/lib/Qpsmtpd/SelectServer.pm index 161e9f8..f621635 100644 --- a/lib/Qpsmtpd/SelectServer.pm +++ b/lib/Qpsmtpd/SelectServer.pm @@ -27,6 +27,12 @@ our $QUIT = 0; $SIG{INT} = $SIG{TERM} = sub { $QUIT++ }; +sub log { + my ($self, $trace, @log) = @_; + warn join(" ", fileno($self->client), @log), "\n" + if $trace <= Qpsmtpd::TRACE_LEVEL(); +} + sub main { my $class = shift; my %opts = (LocalPort => 25, Reuse => 1, Listen => SOMAXCONN, @_); @@ -272,9 +278,11 @@ sub data_line { # DATA is always the end of a "transaction" return $self->reset_transaction; } - - $self->respond(451, "See http://develooper.com/code/qpsmtpd/barelf.html"), exit - if $_ eq ".\n"; + elsif ($_ eq ".\n") { + $self->respond(451, "See http://develooper.com/code/qpsmtpd/barelf.html"); + $self->{__quitting} = 1; + return; + } # add a transaction->blocked check back here when we have line by line plugin access... unless (($self->{__max_size} and $self->{__size} > $self->{__max_size})) {