--- ZMailer.pm.orig	Thu May 20 11:52:46 2004
+++ ZMailer.pm	Thu May 20 11:57:15 2004
@@ -531,10 +531,17 @@
 sub AddRecipients {
   my $this = shift;
   my($message, @recips) = @_;
-  my($recip);
-  foreach $recip (@recips) {
-    push @{$message->{metadata}}, "to <$recip>";
+  #PERT-BBY add the envelope format to addresses:
+  for (@recips) { s/^(.*)$/to <$1>/ };
+  my ($line);
+  my $pos=0;
+  #PERT-BBY now, look for first 'to '
+  foreach $line (@{$message->{metadata}}) {
+    last if ($line =~ /^to /);
+    $pos++;
   }
+  #PERT-BBY and insert the new ones here
+  splice(@{$message->{metadata}} , $pos, 0, @recips);
 }
 
 # Delete the original recipients from the message. We'll add some
