diff options
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/mail-format.c | 27 |
2 files changed, 27 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index a17cab7072..54bad04fe6 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,7 @@ +2001-05-26 Jeffrey Stedfast <fejj@ximian.com> + + * mail-format.c (try_inline_pgp_sig): Fix to work properly. + 2001-05-25 Jeffrey Stedfast <fejj@ximian.com> * folder-browser-factory.c: Added callbacks for Next/Previous diff --git a/mail/mail-format.c b/mail/mail-format.c index 66e90d1e90..95bc7e92f6 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1174,13 +1174,32 @@ try_inline_pgp_sig (char *start, MailDisplay *md) { CamelCipherValidity *valid = NULL; CamelPgpContext *context; - char *end, *pgp_start; + char *end, *msg_start, *pgp_start; + + msg_start = strstr (start, "-----BEGIN PGP SIGNED MESSAGE-----"); + if (msg_start) { + /* skip over -----BEGIN PGP SIGNED MESSAGE----- */ + msg_start = strchr (msg_start, '\n'); + if (!msg_start++) + return start; + + /* skip over Hash: header */ + msg_start = strchr (msg_start, '\n'); + if (!msg_start++) + return start; + } else { + /* Some MUAs don't enclose the signed text in + -----BEGIN PGP SIGNED MESSAGE----- */ + msg_start = start; + } - pgp_start = strstr (start, "-----BEGIN PGP SIGNED MESSAGE-----"); + /* find the beginning of the signature block */ + pgp_start = strstr (msg_start, "-----BEGIN PGP SIGNATURE-----"); if (!pgp_start) return start; - end = strstr (start, "-----END PGP SIGNATURE-----"); + /* find the end of the pgp signature block */ + end = strstr (pgp_start, "-----END PGP SIGNATURE-----"); if (!end) return start; @@ -1208,7 +1227,7 @@ try_inline_pgp_sig (char *start, MailDisplay *md) camel_exception_free (ex); } - mail_text_write (md->html, md->stream, "%.*s", pgp_start - start, start); + mail_text_write (md->html, md->stream, "%.*s", pgp_start - msg_start, msg_start); mail_write_authenticity (md, valid); |