--- Transaction.pm.bak Mon Feb 28 09:41:12 2005 +++ Transaction.pm Mon Feb 28 09:50:57 2005 @@ -70,6 +70,9 @@ $self->{_filename} = $self->temp_file(); $self->{_body_file} = IO::File->new($self->{_filename}, O_RDWR|O_CREAT, 0600) or die "Could not open file $self->{_filename} - $! "; # . $self->{_body_file}->error; + my $headers = $self->header->as_string."\n"; + $self->{_body_file}->print($headers); + $self->{_body_start} = length($headers); }
One tiny little problem with this patch: the $transaction->header isn't populated until _after_ the end of the DATA has been received. See
Qpsmtpd::SMTP line 490, and the loop that receives the DATA at 438-486.
:-(
However, replacing that fragment with this:
=== lib/Qpsmtpd/SMTP.pm
==================================================================
--- lib/Qpsmtpd/SMTP.pm (revision 506)
+++ lib/Qpsmtpd/SMTP.pm (local)
@@ -471,10 +471,14 @@
# FIXME - call plugins to work on just the header here; can
# save us buffering the mail content.+ # Save the start of the body itself
+ $self->{_body_start} = $size;
+
} if ($in_header) {
$buffer .= $_;
+ $self->transaction->body_write($_);
}
else {
$self->transaction->body_write($_);does the right thing more or less; I am getting double header's now. Still working on it.
John
