------=_nmh-multipart
Content-Type: text/plain; charset="Windows-1252"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
Need to go! Need ... to ... go!
------=_nmh-multipart
Content-Type: text/html; charset="Windows-1252"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
<html>
<head>
------=_nmh-multipart-3
Content-Type: text/plain; charset="Windows-1252"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
------=_nmh-multipart
------=_nmh-multipart-1
------=_nmh-multipart-3
Content-Type: text/html; charset="Windows-1252"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
<html>
<head>
------=_nmh-multipart
Content-Type: text/plain; charset="Windows-1252"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
Need to go! Need ... to ... go!
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
Content-Disposition: attachment; filename="test4.txt"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is a text/plain part.
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: attachment; filename="test2.txt"
Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is the second text/plain part.
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
Content-Disposition: attachment; filename="test4.txt"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is the fourth text/plain part.
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="iso-8859-1"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is a text plain part
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="iso-8859-1"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is a text plain part
------=_nmh-multipart
Content-Type: text/plain; charset="ISO-8859-1"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
Mile $0.00
Time $78.71
------=_Part_876302
Content-Type: text/plain; charset="UTF-8"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
Yes, the text/plain part really was empty.
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: attachment; filename="test1.txt"
Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is the text/plain part.
------- =_aaaaaaaaaa0
Content-Type: text/html; charset="iso-8859-1"; name="test2.txt"
Content-Disposition: attachment; filename="test2.txt"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
<html>
<head>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: attachment; filename="test1.txt"
Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is the text/plain part.
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: attachment; filename="test1.txt"
Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is the text/plain part.
------- =_aaaaaaaaaa0
Content-Type: application/ics; charset="iso-8859-1"; name="invite.ics"
Content-Disposition: attachment; filename="invite.ics"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR\r
VERSION:2.0\r
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: attachment; filename="test1.txt"
Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
This is the text/plain part.
------- =_aaaaaaaaaa0
Content-Type: application/ics; charset="iso-8859-1"; name="invite.ics"
Content-Disposition: attachment; filename="invite.ics"
-Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR
VERSION:2.0
static void copy_ctinfo (CI, CI);
static int decode_part (CT);
static int reformat_part (CT, char *, char *, char *, int);
-static int charset_encoding (CT);
static CT build_multipart_alt (CT, CT, int, int);
static int boundary_in_content (FILE **, char *, const char *);
static void transfer_noncontent_headers (CT, CT);
ensure_text_plain (ctp, NULL, &message_mods, fx->replacetextplain);
}
if (status == OK && fx->decodetext) {
- status = decode_text_parts (*ctp, fx->decodetext, fx->decodetypes, &message_mods);
+ status = decode_text_parts (*ctp, fx->decodetext, fx->decodetypes,
+ &message_mods);
}
if (status == OK && fx->textcharset != NULL) {
status = convert_charsets (*ctp, fx->textcharset, &message_mods);
static int
reformat_part (CT ct, char *file, char *type, char *subtype, int c_type) {
int output_subtype, output_encoding;
+ const char *reason = NULL;
char *cp, *cf;
int status;
/* Set subtype to 0, which is always an UNKNOWN subtype. */
output_subtype = 0;
}
- output_encoding = charset_encoding (ct);
+ output_encoding = content_encoding (ct, &reason);
if (set_ct_type (ct, c_type, output_subtype, output_encoding) == OK) {
ct->c_cefile.ce_file = file;
ct->c_cefile.ce_unlink = 1;
}
-/*
- * Identifies 7bit or 8bit content based on charset.
- */
-static int
-charset_encoding (CT ct) {
- char *ct_charset = content_charset (ct);
- int encoding = strcasecmp (ct_charset, "US-ASCII") ? CE_8BIT : CE_7BIT;
-
- free (ct_charset);
-
- return encoding;
-}
-
-
/*
* Fill in a multipart/alternative part.
*/
* that character set again after decoding."
*/
static int
-decode_text_parts (CT ct, int encoding, const char *decodetypes, int *message_mods) {
+decode_text_parts (CT ct, int encoding, const char *decodetypes,
+ int *message_mods) {
int status = OK;
int lf_line_endings = 0;
/* Should check to see if the body for this part is encoded?
For now, it gets passed along as-is by InitMultiPart(). */
for (part = m->mp_parts; status == OK && part; part = part->mp_next) {
- status = decode_text_parts (part->mp_part, encoding, decodetypes, message_mods);
+ status = decode_text_parts (part->mp_part, encoding, decodetypes,
+ message_mods);
}
break;
}
if (ct->c_subtype == MESSAGE_EXTERNAL) {
struct exbody *e = (struct exbody *) ct->c_ctparams;
- status = decode_text_parts (e->eb_content, encoding, decodetypes, message_mods);
+ status = decode_text_parts (e->eb_content, encoding, decodetypes,
+ message_mods);
}
break;
ct->c_cefile.ce_file = NULL;
} else {
int enc;
+
if (ct_encoding == CE_BINARY) {
enc = CE_BINARY;
} else if (ct_encoding == CE_8BIT && encoding == CE_7BIT) {
enc = CE_QUOTED;
} else {
- enc = charset_encoding (ct);
+ enc = ct_encoding;
}
if (set_ce (ct, enc) == OK) {
++*message_mods;