--- Exim.pm.old	Thu Feb  6 17:12:56 2003
+++ Exim.pm	Mon Mar 10 12:08:43 2003
@@ -242,7 +242,7 @@
 
   my %metadata;
   my($InHeader, $InSubject, $InDel, @headers, $msginfo, $from, @to, $subject);
-  my($ip);
+  my($ip, $sender);
   my($line);
 
   # Seek to the start of the file in case anyone read the file
@@ -254,8 +254,16 @@
   # username, uid, gid that submitted message
   chomp(($metadata{user},$metadata{uid},$metadata{gid}) = split / /, <$RQf>);
   # envelope-sender (in <>)
-  chomp($metadata{sender} = <$RQf>);
-  $message->{from} = lc $metadata{sender};
+  $sender = <$RQf>;
+  chomp $sender;
+  $sender =~ s/^<\s*//; # leading and
+  $sender =~ s/\s*>$//; # trailing <>
+  $sender = lc($sender);
+  $metadata{sender} = $sender;
+  $message->{from}  = $sender;
+  #JKF Don't want the < or >
+  #JKF chomp($metadata{sender} = <$RQf>);
+  #JKF $message->{from} = lc $metadata{sender};
   # time msg received (seconds since epoch)
   # + number of delay warnings sent
   chomp(($metadata{rcvtime},$metadata{warncnt}) = split / /, <$RQf>);
@@ -899,6 +907,7 @@
   my $this = shift;
   my($message) = @_;
 
+  $message->{metadata}{numrcpts} = 0;
   $message->{metadata}{rcpts} = [];
   $message->{metadata}{nonrcpts} = {};
 
@@ -938,7 +947,8 @@
   $Qfile .= $metadata->{gid} . "\n";
 
   # Add sender line
-  $Qfile .= $metadata->{sender} . "\n";
+  $Qfile .= '<' . $metadata->{sender} . ">\n";
+  # JKF Need the < and > round the sender $Qfile .= $metadata->{sender} . "\n";
 
   # Add time received and warning count
   $Qfile .= $metadata->{rcvtime} . " ";