summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2019-01-01 10:44:27 -0700
committerEduardo Chappa <chappa@washington.edu>2019-01-01 10:44:27 -0700
commit69950995bed9305ebc6dabab64f017b544bc8f1e (patch)
tree467ea3c45b46fd575fdb16e8d0175e9c38ceb1c7
parent3fb6fc0a247bbd5a035ff9291f9022bd2a998355 (diff)
downloadalpine-69950995bed9305ebc6dabab64f017b544bc8f1e.tar.xz
* Some servers report the encoding of a message/rfc822 as 8bit, and
because of that, Alpine sets their encoding to quoted-printable, in contradiction to RFC 2045. We handle this by keeping the encoding reported by the server. Based on a report by Holger Trapp.
-rw-r--r--pith/pine.hlp6
-rw-r--r--pith/send.c17
2 files changed, 16 insertions, 7 deletions
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 6d8b40b..138b105 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -262,6 +262,12 @@ Bugs that have been addressed include:
alpine/mailpart.c:format_msg_att()") with no example, and reported
now by Holger Trapp, with an example.
+ <LI> In addition to the previous report, Alpine encodes message/rfc822
+ messages as QUOTED-PRINTABLE, in contradiction with RFC 2045,
+ when it receives a report that its encoding is 8bit. We preserve
+ the encoding reported by the IMAP server, and do not encode in
+ QUOTED-PRINTABLE.
+
<LI> Update build.bat file to add /DWINVER=0x0501 so that Alpine can
build when using Visual Studio 2017. Fix contributed by
Ulf-Dietrich Braunmann.
diff --git a/pith/send.c b/pith/send.c
index e72b6d9..b724385 100644
--- a/pith/send.c
+++ b/pith/send.c
@@ -4520,21 +4520,24 @@ pine_write_body_header(struct mail_bodystruct *body, soutr_t f, void *s)
if(!pine_write_params(body->parameter, so))
return(pwbh_finish(0, so));
}
- else if(!so_puts(so, "; CHARSET=US-ASCII"))
+ else if ((body->type != TYPEMESSAGE
+ || (body->subtype && strucmp(body->subtype, "RFC822")))
+ && (!so_puts(so, "; CHARSET=US-ASCII")))
return(pwbh_finish(0, so));
if(!so_puts(so, "\015\012"))
return(pwbh_finish(0, so));
+ /* do not change the encoding of a TYPEMESSAGE part */
if ((body->encoding /* note: encoding 7BIT never output! */
&& !(so_puts(so, "Content-Transfer-Encoding: ")
&& so_puts(so, body_encodings[(body->encoding==ENCBINARY)
- ? ENCBASE64
- : (body->encoding == ENC8BIT)
- ? ENCQUOTEDPRINTABLE
- : (body->encoding <= ENCMAX)
- ? body->encoding
- : ENCOTHER])
+ ? (body->type == TYPEMESSAGE ? ENCBINARY : ENCBASE64)
+ : (body->encoding == ENC8BIT)
+ ?(body->type == TYPEMESSAGE ? ENC8BIT : ENCQUOTEDPRINTABLE)
+ : (body->encoding <= ENCMAX)
+ ? body->encoding
+ : ENCOTHER])
&& so_puts(so, "\015\012")))
/*
* If requested, strip Content-ID headers that don't look like they