summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-01-09 15:33:34 +0100
committerDavid Lawrence <dkl@mozilla.com>2015-01-09 15:33:34 +0100
commit2bf5ed2df1e4929b4c27ad8844932979d482fe26 (patch)
tree011a16dcc5e9a1290d0b225ee57e1ab44e5b22c5
parent0b5e63fd4478ca93114cdaabe0b267883b5f54eb (diff)
downloadbugzilla-2bf5ed2df1e4929b4c27ad8844932979d482fe26.tar.gz
bugzilla-2bf5ed2df1e4929b4c27ad8844932979d482fe26.tar.xz
Bug 1118724: Private comments on public bugs are sent unencrypted by email
-rw-r--r--extensions/SecureMail/Extension.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index a8299860c..582b9e127 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -318,6 +318,13 @@ sub mailer_before_send {
"SELECT isprivate FROM longdescs WHERE bug_id=? ORDER BY bug_when",
undef, $bug_id);
# Encrypt if there are private comments on an otherwise public bug
+ if (scalar $email->parts > 1) {
+ $email->walk_parts(sub {
+ my $part = shift;
+ my $content_type = $part->content_type;
+ $body = $part->body if $content_type && $content_type =~ /^text\/plain/;
+ });
+ }
while ($body =~ /[\r\n]--- Comment #(\d+)/g) {
my $comment_number = $1;
if ($comment_number && $comment_is_private->[$comment_number]) {