[evolution/gnome-40] I#1475 - Mail: Read Subject from PGP encrypted mail even without text/rfc822-headers part ][



commit cbbcf7087927c3c31df5155f927c7f140aa7d1d2
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 4 19:13:14 2021 +0200

    I#1475 - Mail: Read Subject from PGP encrypted mail even without text/rfc822-headers part ][
    
    The protected headers can be included also under the multipart/signed part,
    not only directly under the encrypted part.
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1475

 src/em-format/e-mail-parser-multipart-mixed.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/em-format/e-mail-parser-multipart-mixed.c b/src/em-format/e-mail-parser-multipart-mixed.c
index c421eb2c2b..1912b1bd4e 100644
--- a/src/em-format/e-mail-parser-multipart-mixed.c
+++ b/src/em-format/e-mail-parser-multipart-mixed.c
@@ -57,7 +57,8 @@ empe_mp_mixed_maybe_update_message_info_headers (EMailParser *parser,
 
        /* The Subject can be changed only if this is the top message, thus when
           the encrypted message/part is not an attachment. */
-       if (g_strcmp0 (part_id, ".message.encrypted-pgp") != 0)
+       if (g_strcmp0 (part_id, ".message.encrypted-pgp") != 0 &&
+           g_strcmp0 (part_id, ".message.encrypted-pgp.signed.0") != 0)
                return;
 
        part_list = e_mail_parser_ref_part_list_for_operation (parser, cancellable);
@@ -177,7 +178,7 @@ empe_mp_mixed_parse (EMailParserExtension *extension,
                        continue;
                }
 
-               if (i == 0 && g_str_has_suffix (part_id->str, ".encrypted-pgp")) {
+               if (i == 0 && (g_str_has_suffix (part_id->str, ".encrypted-pgp") || g_str_has_suffix 
(part_id->str, ".encrypted-pgp.signed.0"))) {
                        ct = camel_mime_part_get_content_type (part);
                        if (ct && camel_content_type_param (ct, "protected-headers")) {
                                const gchar *subject;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]