aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-08-29 07:02:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-08-29 07:02:05 +0000
commit746675aaf576e27d3d04410a0fcff85ff889b64d (patch)
tree4afd9df468fe02c32325a2e5d15f54b7ad20fc17
parenta885089095e4cb64967307c25d4d92305a79a645 (diff)
fixed broken message/* attachments on pgp-sign.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@519 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.ja6
-rw-r--r--src/compose.c28
3 files changed, 29 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index e34a1b32..975a2dce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-29
+
+ * src/compose.c: compose_write_attach(): don't encode message/*
+ parts with quoted-printable or base64 (fixes broken attachments
+ on pgp-sign).
+
2005-08-26
* src/compose.c: the line space setting now applies to the compose
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 5fa6cf07..219e7006 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,9 @@
+2005-08-29
+
+ * src/compose.c: compose_write_attach(): message/* のパートを
+ quoted-printable または base64 でエンコードしないようにした
+ (pgp 署名時に添付ファイルが壊れるバグを修正)。
+
2005-08-26
* src/compose.c: 行間の設定がメッセージ作成ウィンドウに適用される
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));