my $compose_filename = ".msg.$$";
 
 # Variables we fill in automatically, or via prompting:
-my (@to,@cc,@initial_cc,@bcclist,
+my (@to,@cc,@initial_cc,@bcclist,@xh,
        $initial_reply_to,$initial_subject,@files,$from,$compose,$time);
 
 # Behavior modification variables
                $header .= "In-Reply-To: $reply_to\n";
                $header .= "References: $references\n";
        }
+       if (@xh) {
+               $header .= join("\n", @xh) . "\n";
+       }
 
        if ($smtp_server =~ m#^/#) {
                my $pid = open my $sm, '|-';
 
        my $author_not_sender = undef;
        @cc = @initial_cc;
+       @xh = ();
        my $found_mbox = 0;
        my $header_done = 0;
        $message = "";
                                                $2, $_) unless $quiet;
                                        push @cc, $2;
                                }
+                               elsif (/^[-A-Za-z]+:\s+\S/) {
+                                       push @xh, $_;
+                               }
 
                        } else {
                                # In the traditional