diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-08-29 07:02:05 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-08-29 07:02:05 +0000 |
commit | 746675aaf576e27d3d04410a0fcff85ff889b64d (patch) | |
tree | 4afd9df468fe02c32325a2e5d15f54b7ad20fc17 /src/compose.c | |
parent | a885089095e4cb64967307c25d4d92305a79a645 (diff) |
fixed broken message/* attachments on pgp-sign.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@519 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r-- | src/compose.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/compose.c b/src/compose.c index 43079476..ef98bbff 100644 --- a/src/compose.c +++ b/src/compose.c @@ -3254,9 +3254,16 @@ static void compose_write_attach(Compose *compose, FILE *fp, fprintf(fp, "\n--%s\n", compose->boundary); - if (!g_ascii_strcasecmp(ainfo->content_type, "message/rfc822")) { + encoding = ainfo->encoding; + + if (!g_ascii_strncasecmp(ainfo->content_type, "message/", 8)) { fprintf(fp, "Content-Type: %s\n", ainfo->content_type); fprintf(fp, "Content-Disposition: inline\n"); + + /* message/... shouldn't be encoded */ + if (encoding == ENC_QUOTED_PRINTABLE || + encoding == ENC_BASE64) + encoding = ENC_8BIT; } else { compose_convert_header(compose, filename, sizeof(filename), @@ -3266,19 +3273,18 @@ static void compose_write_attach(Compose *compose, FILE *fp, ainfo->content_type, filename); fprintf(fp, "Content-Disposition: attachment;\n" " filename=\"%s\"\n", filename); - } - - encoding = ainfo->encoding; #if USE_GPGME - /* force encoding to protect trailing spaces */ - if (compose->use_signing) { - if (encoding == ENC_7BIT) - encoding = ENC_QUOTED_PRINTABLE; - else if (encoding == ENC_8BIT) - encoding = ENC_BASE64; - } + /* force encoding to protect trailing spaces */ + if (compose->use_signing && + !compose->account->clearsign) { + if (encoding == ENC_7BIT) + encoding = ENC_QUOTED_PRINTABLE; + else if (encoding == ENC_8BIT) + encoding = ENC_BASE64; + } #endif + } fprintf(fp, "Content-Transfer-Encoding: %s\n\n", procmime_get_encoding_str(encoding)); |