commit e070e40476000c39f65ab00bb7071ab95b3d4869
parent 244b9cae9f63616168222e9adfa32f26e5388001
Author: Paul <paul@claws-mail.org>
Date: Mon, 26 Sep 2016 10:59:43 +0100
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.
Diffstat:
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/manual/advanced.xml b/manual/advanced.xml
@@ -806,6 +806,20 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><literal>rewrite_first_from</literal></term>
+ <listitem>
+ <para>
+ '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.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><literal>save_parts_readwrite</literal></term>
<listitem>
<para>
diff --git 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
@@ -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
@@ -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;