summaryrefslogtreecommitdiff
path: root/pith/send.c
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 /pith/send.c
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.
Diffstat (limited to 'pith/send.c')
-rw-r--r--pith/send.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/pith/send.c b/pith/send.c
index e72b6d98..b7243859 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