]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2004-08-05 15:09:30 by cjwatson]
authorcjwatson <>
Thu, 5 Aug 2004 22:09:30 +0000 (14:09 -0800)
committercjwatson <>
Thu, 5 Aug 2004 22:09:30 +0000 (14:09 -0800)
Cope with empty Reply-To: header (#263741).

scripts/process.in

index 8bc235017f122dde5fec42580ebf61496bc557cf..267d77f9671f7e07bafccc37e15fc7c72e3a69f5 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: process.in,v 1.85 2004/02/27 02:05:17 cjwatson Exp $
+# $Id: process.in,v 1.86 2004/08/05 15:09:30 cjwatson Exp $
 #
 # Usage: process nn
 # Temps:  incoming/Pnn
@@ -152,7 +152,14 @@ if (defined $header{'resent-from'} && !defined $header{'from'}) {
     $header{'from'} = $header{'resent-from'};
 }
 defined($header{'from'}) || &quit("no From header");
-$replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
+
+$replyto = $header{'reply-to'};
+$replyto = '' unless defined $replyto;
+$replyto =~ s/^ +//;
+$replyto =~ s/ +$//;
+unless (length $replyto) {
+    $replyto = $header{'from'};
+}
 
 $_= $replyto;
 $_= "$2 <$1>" if m/^([^\<\> \t\n\(\)]+) \(([^\(\)\<\>]+)\)$/;