summaryrefslogtreecommitdiffstats
path: root/extensions/SecureMail
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-10-30 07:58:13 +0100
committerByron Jones <bjones@mozilla.com>2013-10-30 07:58:13 +0100
commit1b28e5b941d480249d4dd637138a3781d6f9cd05 (patch)
treea69d86f0194417e096ceb1a460ca7d064403128c /extensions/SecureMail
parent7f7de14b517a953e83c97ec5a268613442826b8c (diff)
downloadbugzilla-1b28e5b941d480249d4dd637138a3781d6f9cd05.tar.gz
bugzilla-1b28e5b941d480249d4dd637138a3781d6f9cd05.tar.xz
Bug 892615: update requestnagging to suport securemail
Diffstat (limited to 'extensions/SecureMail')
-rw-r--r--extensions/SecureMail/Extension.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index 8fd09510d..a4a23a2cd 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -261,8 +261,14 @@ sub mailer_before_send {
my $is_passwordmail = !$is_bugmail && ($body =~ /cfmpw.*cxlpw/s);
my $is_test_email = $email->header('X-Bugzilla-Type') =~ /securemail-test/ ? 1 : 0;
my $is_whine_email = $email->header('X-Bugzilla-Type') eq 'whine' ? 1 : 0;
-
- if ($is_bugmail || $is_passwordmail || $is_test_email || $is_whine_email) {
+ my $encrypt_header = $email->header('X-Bugzilla-Encrypt') ? 1 : 0;
+
+ if ($is_bugmail
+ || $is_passwordmail
+ || $is_test_email
+ || $is_whine_email
+ || $encrypt_header
+ ) {
# Convert the email's To address into a User object
my $login = $email->header('To');
my $emailsuffix = Bugzilla->params->{'emailsuffix'};
@@ -329,6 +335,11 @@ sub mailer_before_send {
# comes from the whine settings.
$make_secure = _should_secure_whine($email) ? SECURE_BODY : SECURE_NONE;
}
+ elsif ($encrypt_header) {
+ # Templates or code may set the X-Bugzilla-Encrypt header to
+ # trigger encryption of emails. Remove that header from the email.
+ $email->header_set('X-Bugzilla-Encrypt');
+ }
# If finding the user fails for some reason, but we determine we
# should be encrypting, we want to make the mail safe. An empty key