From a52660a646012691f993cca821c00fe05cff08bb Mon Sep 17 00:00:00 2001 From: jaredj Date: Wed, 25 Mar 2009 07:38:05 -0500 Subject: [PATCH] Spool body when $transaction->body_fh() is called Qpsmtpd::Transaction::body_filename() calls $self->body_spool() if the message body has not already been spool to disk. This adds the same check to Qpsmtpd::Transaction::body_fh() --- lib/Qpsmtpd/Transaction.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Qpsmtpd/Transaction.pm b/lib/Qpsmtpd/Transaction.pm index 545109d..18635ad 100644 --- a/lib/Qpsmtpd/Transaction.pm +++ b/lib/Qpsmtpd/Transaction.pm @@ -214,7 +214,10 @@ sub body_as_string { } sub body_fh { - return shift->{_body_file}; + my ($self) = @_; + # Spool to disk if we weren't already doing so + $self->body_spool() unless $self->{_filename}; + return $self->{_body_file}; } sub dup_body_fh {