Hi,
Not a great improvement, just moves code. Exiting as soon as you know
you have to.
--- SMTP.pm.old 2008-05-09 19:03:21.000000000 +0200
+++ SMTP.pm 2008-05-09 19:22:46.000000000 +0200
@@ -668,6 +668,14 @@
#$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300);
}
+ # if we get here without seeing a terminator, the connection is
+ # probably dead.
+ unless ( $complete ) {
+ $self->respond(451, "Incomplete DATA");
+ $self->reset_transaction; # clean up after ourselves
+ return 1;
+ }
+
$self->log(LOGDEBUG, "max_size: $max_size / size: $size");
$self->transaction->header($header);
@@ -690,14 +698,6 @@
$header->add("Received", $self->received_line($smtp, $authheader,
$sslheader), 0);
- # if we get here without seeing a terminator, the connection is
- # probably dead.
- unless ( $complete ) {
- $self->respond(451, "Incomplete DATA");
- $self->reset_transaction; # clean up after ourselves
- return 1;
- }
-
#$self->respond(550, $self->transaction->blocked),return 1 if
($self->transaction->blocked);
if ($max_size and $size > $max_size) {
$self->log(LOGALERT, "Message too big: size: $size (max size:
$max_size)");
Jose Luis Martinez
[EMAIL PROTECTED]