diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index 1f4f2d0..d0d6180 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -429,11 +429,8 @@ sub data { my $header = Mail::Header->new(Modify => 0, MailFrom => "COERCE"); - my $timeout = $self->config('timeout'); - alarm $timeout; - - while () { + while (defined($_ = $self->getline)) { $complete++, last if $_ eq ".\r\n"; $i++; @@ -481,8 +478,6 @@ sub data { $size += length $_; } #$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300); - - alarm $timeout; } $self->log(LOGDEBUG, "max_size: $max_size / size: $size"); @@ -528,6 +523,17 @@ sub data { } +sub getline { + my $self = shift; + + my $timeout = $self->config('timeout'); + + alarm $timeout; + my $line = ; # default implementation + alarm 0; + return $line; +} + sub queue { my ($self, $transaction) = @_;