On Thu, 19 May 2005 17:39:35 +0200
Juerd <[EMAIL PROTECTED]> wrote:

> I recently upgraded from 0.27 to 0.30-dev because I needed the
> forkserver. Approximately a quarter of all mail I receive now, has part
> of the headers repeated in the body, beginning somewhere in the middle
> of a header.

Are you using queue/qmail-queue?  Does it matter whether the message is
larger than memory_threshold (default 10,000 bytes)?

If so, does the attached patch help?

Brian
--- ../../upstream/trunk/lib/Qpsmtpd/Transaction.pm     2005-05-18 
16:11:30.000000000 -0600
+++ qpsmtpd/lib/Qpsmtpd/Transaction.pm  2005-05-18 16:11:36.000000000 -0600
@@ -64,6 +64,17 @@
 sub set_body_start {
     my $self = shift;
     $self->{_body_start} = $self->body_current_pos;
+    if ($self->{_body_file}) {
+               $self->{_header_size} = $self->{_body_start};
+               }
+       else {
+               $self->{_header_size} = 0;
+               if ($self->{_body_array}) {
+                       foreach my $line (@{ $self->{_body_array} }) {
+                               $self->{_header_size} += length($line);
+                               }
+                       }
+               }
 }
 
 sub body_start {
@@ -123,6 +134,7 @@
         foreach my $line (@{ $self->{_body_array} }) {
           $self->{_body_file}->print($line) or die "Cannot print to temp file: 
$!";
         }
+               $self->{_body_start} = $self->{_header_size};
       }
       $self->{_body_array} = undef;
     }
@@ -160,6 +172,7 @@
   }
   else {
     return unless $self->{_body_array};
+       $self->{_body_current_pos} = 0 if !defined $self->{_body_current_pos};
     my $line = $self->{_body_array}->[$self->{_body_current_pos}];
     $self->{_body_current_pos}++;
     return $line;

Reply via email to