--- Postfix.pm.old	2004-03-24 10:12:27.000000000 +0000
+++ Postfix.pm	2004-03-31 00:34:58.000000000 +0100
@@ -287,6 +287,7 @@
 
     #print STDERR "In ReadQf\n";
     #$message->{store}->print();
+    $message->{nobody} = 0; # If there is no message body we just get X at end of headers
 
     # Just in case we get a message with no headers at all
     @{$message->{headers}} = ();
@@ -360,9 +362,11 @@
     # we get an empty N record which is the blank line just after the
     # headers.
     #print STDERR "Reading message body\n";
-    while(($rectype, $recdata) = ReadRecord($RQf)) {
+    while(!$message->{nobody} && (($rectype, $recdata) = ReadRecord($RQf))) {
+      #print STDERR "Reading headers: $rectype, $recdata\n";
       if ($rectype eq 'X') {
-        push @{$message->{metadata}}, "$rectype$recdata";
+        #push @{$message->{metadata}}, "$rectype$recdata";
+        $message->{nobody} = 1; # Found end of message before message body text
         last;
       }
       last if $rectype eq 'N' && $recdata eq "";
@@ -857,10 +864,11 @@
       #print STDERR "Pre $type $data\n";
     }
 
-    # Add the header-body separator line
-    $result .= Record2String('N', "");
+    # Add the header-body separator line if there is a message body
+    #print STDERR "No body flag is " . $message->{nobody} . "\n";
+    $result .= Record2String('N', "") unless $message->{nobody};
 
-    #print STDERR "Result is $result\n";
+    #print STDERR "Result of PreDataString is $result\n";
     # Return the string and the length of the data before any N records
     return ($result, $preNlen);
   }