]> git.donarmstrong.com Git - debbugs.git/blobdiff - scripts/process
include non-breaking spaces in pheader regex for old perl (≤5.18)
[debbugs.git] / scripts / process
index 2e0e0030909a380e7b578dadb54d943b8fd0f112..38e4f90c8c1a1e326b5530d8bed341ba29f9a109 100755 (executable)
@@ -180,8 +180,8 @@ for my $hdr (@headerlines) {
     $_ = $hdr;
     s/\n\s/ /g;
     finish() if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail";
-    my $ins = !m/^subject:/i && !m/^reply-to:/i && !m/^return-path:/i
-           && !m/^From / && !m/^X-Debbugs-/i;
+    my $ins = !m/^(?:(?:subject|reply-to|return-path|mail-followup-to):
+                |From\s|X-Debbugs-)/xi;
     $fwd .= encode_utf8($hdr)."\n" if $ins;
     # print {$debugfh} ">$_<\n";
     if (s/^(\S+):\s*//) {
@@ -225,7 +225,10 @@ for my $phline (@bodylines)
     # Fixes #488554
     $phline =~ s/\xef\xbb\xbf//g;
     $phline =~ s/\N{U+FEFF}//g;
-    last if $phline !~ m/^([\w-]+):\s*(\S.*)/;
+    last if $phline !~ m/^([\w-]+): # psuedoheader
+                        (?:\s|\N{U+00A0})* # zero or more spaces, including
+                                            # non-breaking space
+                        (\S.*)/x; # pseudoheader value
     my ($fn, $fv) = ($1, $2);
     $fv =~ s/\s*$//;
     # pluralize tag/usertag
@@ -503,6 +506,8 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
               "X-$gProject-PR-Keywords" => $data->{keywords},
              # Only have a X-$gProject-PR-Source when we know the source package
              (defined($source_package) and length($source_package))?("X-$gProject-PR-Source" => $source_package):(),
+              "Reply-To"                => "$ref\@$gEmailDomain",
+              "Content-Type"            => 'text/plain; charset="utf-8"',
              ],message_body_template('mail/process_mark_as_forwarded',
                                     {date => $header{date},
                                      messageid => $header{'message-id'},
@@ -526,6 +531,8 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
               "X-$gProject-PR-Keywords" => $data->{keywords},
              # Only have a X-$gProject-PR-Source when we know the source package
              (defined($source_package) and length($source_package))?("X-$gProject-PR-Source" => $source_package):(),
+              "Reply-To"                => "$ref\@$gEmailDomain",
+              "Content-Type"            => 'text/plain; charset="utf-8"',
              ],message_body_template('mail/process_mark_as_done',
                                     {date => $header{date},
                                      messageid => $header{'message-id'},