From e070e40476000c39f65ab00bb7071ab95b3d4869 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 26 Sep 2016 10:59:43 +0100 Subject: [PATCH] add hidden pref 'reqrite_first_from' '0' or '1'. This works around a limitation of some servers with 'overly-liberal parsers'. When this is turned on and the Content- Transfer-Encoding is set to 8bit or 7bit, in a message body starting with 'From ' the 'From ' will become '=46rom ' and the Content-Transfer-Encoding will be changed to Quoted-Printable. When it is turned off no such modification will be made but it is very likely that an MTA will convert the 'From ' to '>From '. See RFC 4155 for further details. Default value is '1', turned on. --- manual/advanced.xml | 14 ++++++++++++++ src/compose.c | 2 +- src/prefs_common.c | 2 ++ src/prefs_common.h | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/manual/advanced.xml b/manual/advanced.xml index 12c12a042..9c4b05605 100644 --- a/manual/advanced.xml +++ b/manual/advanced.xml @@ -805,6 +805,20 @@ + + rewrite_first_from + + + '0' or '1'. This works around a limitation of some servers with + 'overly-liberal parsers'. When this is turned on and the Content- + Transfer-Encoding is set to 8bit or 7bit, in a message body starting with + 'From ' the 'From ' will become '=46rom ' and the Content-Transfer-Encoding + will be changed to Quoted-Printable. When it is turned off no such modification + will be made but it is very likely that an MTA will convert the 'From ' to + '>From '. See RFC 4155 for further details. Default value is '1', turned on. + + + save_parts_readwrite diff --git a/src/compose.c b/src/compose.c index d216a4b62..b05006b01 100644 --- a/src/compose.c +++ b/src/compose.c @@ -5653,7 +5653,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool } g_free(chars); - if (encoding == ENC_8BIT || encoding == ENC_7BIT) { + if (prefs_common.rewrite_first_from && (encoding == ENC_8BIT || encoding == ENC_7BIT)) { if (!strncmp(buf, "From ", sizeof("From ")-1) || strstr(buf, "\nFrom ") != NULL) { encoding = ENC_QUOTED_PRINTABLE; diff --git a/src/prefs_common.c b/src/prefs_common.c index 39d9a0ba8..feeb95696 100644 --- a/src/prefs_common.c +++ b/src/prefs_common.c @@ -199,6 +199,8 @@ static PrefParam param[] = { NULL, NULL, NULL}, {"outgoing_fallback_to_ascii", "TRUE", &prefs_common.outgoing_fallback_to_ascii, P_BOOL, NULL, NULL, NULL}, + {"rewrite_first_from", "TRUE", &prefs_common.rewrite_first_from, + P_BOOL, NULL, NULL, NULL}, {"warn_empty_subj", "TRUE", &prefs_common.warn_empty_subj, P_BOOL, NULL, NULL, NULL}, {"hide_timezone", "FALSE", &prefs_common.hide_timezone, diff --git a/src/prefs_common.h b/src/prefs_common.h index d3d9fa941..2c56b4de1 100644 --- a/src/prefs_common.h +++ b/src/prefs_common.h @@ -142,6 +142,7 @@ struct _PrefsCommon gchar *outgoing_charset; TransferEncodingMethod encoding_method; gboolean outgoing_fallback_to_ascii; + gboolean rewrite_first_from; gboolean warn_empty_subj; gboolean hide_timezone; gboolean allow_jisx0201_kana; -- 2.25.1