From 4c01b9963480b373ec08c9e21757caa23cac1cc8 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 27 Sep 2016 18:15:25 -0700 Subject: [PATCH] RFC2047-decode mailto header values. (closes #3879) RFC 6068 specifies that the header values (with the exception of body) may contain RFC 2047-encoded values. --- url.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/url.c b/url.c index 42a6e090..ee355a56 100644 --- a/url.c +++ b/url.c @@ -29,6 +29,7 @@ #include "url.h" #include "mime.h" +#include "rfc2047.h" #include @@ -304,12 +305,17 @@ int url_parse_mailto (ENVELOPE *e, char **body, const char *src) else { char *scratch; + char *decoded_value; size_t taglen = mutt_strlen (tag); - safe_asprintf (&scratch, "%s: %s", tag, value); + decoded_value = safe_strdup (value); + rfc2047_decode (&decoded_value); + + safe_asprintf (&scratch, "%s: %s", tag, decoded_value); scratch[taglen] = 0; /* overwrite the colon as mutt_parse_rfc822_line expects */ value = skip_email_wsp(&scratch[taglen + 1]); mutt_parse_rfc822_line (e, NULL, scratch, value, 1, 0, 0, &last); + FREE (&decoded_value); FREE (&scratch); } } -- 2.40.0