aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-05-15 04:34:58 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-05-15 04:34:58 +0000
commitc5575f297c9e68bb0eaad671b4afb25ebe441186 (patch)
tree29b6cc0aa03f452f8ef3f5bf2e40a88449910293 /src
parent017021009d0c7d9c6812834bb952edfd5411d3a5 (diff)
use quoted-printable or base64 to protect trailing spaces on PGP/MIME signing except for ISO-2022-JP.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1693 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/compose.c b/src/compose.c
index f3772c2d..b0b32bb4 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -3075,19 +3075,22 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
buf = canon_buf;
#if USE_GPGME
- /* chomp all trailing spaces */
+ /* protect trailing spaces */
if (rfc2015_is_available() && !is_draft &&
compose->use_signing && !compose->account->clearsign) {
- gchar *tmp;
- tmp = strchomp_all(buf);
- g_free(buf);
- buf = tmp;
-#if 0
- if (encoding == ENC_7BIT)
- encoding = ENC_QUOTED_PRINTABLE;
- else if (encoding == ENC_8BIT)
- encoding = ENC_BASE64;
-#endif
+ if (encoding == ENC_7BIT) {
+ if (!g_ascii_strcasecmp(body_charset, CS_ISO_2022_JP)) {
+ gchar *tmp;
+ tmp = strchomp_all(buf);
+ g_free(buf);
+ buf = tmp;
+ } else
+ encoding = ENC_QUOTED_PRINTABLE;
+ } else if (encoding == ENC_8BIT) {
+ encoding = procmime_get_encoding_for_str(buf);
+ if (encoding == ENC_7BIT)
+ encoding = ENC_QUOTED_PRINTABLE;
+ }
}
if (rfc2015_is_available() && !is_draft &&