diff options
Diffstat (limited to 'extensions/SecureMail/Extension.pm')
-rw-r--r-- | extensions/SecureMail/Extension.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm index 97722d9ac..4e1bbf237 100644 --- a/extensions/SecureMail/Extension.pm +++ b/extensions/SecureMail/Extension.pm @@ -32,6 +32,7 @@ use Crypt::OpenPGP::Armour; use Crypt::OpenPGP::KeyRing; use Crypt::OpenPGP; use Crypt::SMIME; +use Encode; our $VERSION = '0.4'; @@ -256,11 +257,16 @@ sub _make_secure { ################## # PGP Encryption # ################## - my $body = $email->body; + + # We need to work with the body as a decoded string as we may + # modify it + my $body = $email->body_str; if ($is_bugmail) { # Subject gets placed in the body so it can still be read $body = "Subject: $subject\n\n" . $body; } + # Crypt::OpenPGP requires an encoded string + $body = encode('UTF8', $body); my $pubring = new Crypt::OpenPGP::KeyRing(Data => $key); my $pgp = new Crypt::OpenPGP(PubRing => $pubring); |