]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Recipients.pm
allow complete sset of RFC2822 comments
[debbugs.git] / Debbugs / Recipients.pm
index a73bbd9a91bc933df62b45fa0ad0beb16f62835a..9421a6008e835c4ea235876f00a862faad472339 100644 (file)
@@ -140,18 +140,18 @@ sub add_recipients {
                            type  => 'bcc',
                           );
          }
-         if (defined(getmaintainers()->{$p})) {
-              $addmaint= getmaintainers()->{$p};
-              print {$param{debug}} "MR|$addmaint|$p|$ref|\n";
-              _add_address(recipients => $param{recipients},
-                           address => $addmaint,
-                           reason => $p,
-                           bug_num => $param{data}{bug_num},
-                           type  => 'cc',
-                          );
-              print {$param{debug}} "maintainer add >$p|$addmaint<\n";
+         my @maints = package_maintainer(binary => $p);
+         if (@maints) {
+             print {$param{debug}} "MR|".join(',',@maints)."|$p|$ref|\n";
+             _add_address(recipients => $param{recipients},
+                          address => \@maints,
+                          reason => $p,
+                          bug_num => $param{data}{bug_num},
+                          type  => 'cc',
+                         );
+             print {$param{debug}} "maintainer add >$p|".join(',',@maints)."<\n";
          }
-         else { 
+         else {
               print {$param{debug}} "maintainer none >$p<\n";
               print {$param{transcript}} "Warning: Unknown package '$p'\n";
               print {$param{debug}} "MR|unknown-package|$p|$ref|\n";
@@ -291,8 +291,13 @@ sub determine_recipients {
                         $level = 'cc';
                    }
               }
-              # strip out all non-word non-spaces
-              $reason =~ s/[^\ \w]//g;
+              # RFC 2822 comments cannot contain specials and
+              # unquoted () or \; there's no reason for us to allow
+              # insane things here, though, so we restrict this even
+              # more to 20-7E ( -~)
+              $reason =~ s/\\/\\\\/g;
+              $reason =~ s/([\)\(])/\\$1/g;
+              $reason =~ s/[^\x20-\x7E]//g;
               push @reasons, $reason . ' for {'.join(',',@bugs).'}';
          }
          if ($param{address_only}) {