From 85f6fab6a917e911a3d2b35851f571838604be63 Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Tue, 29 Jun 2021 23:53:13 -0400 Subject: [PATCH] EMAIL: Support multiline Content-Type in email body --- apps/email.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/email.c b/apps/email.c index 66a1d38..153d0d7 100644 --- a/apps/email.c +++ b/apps/email.c @@ -1169,9 +1169,8 @@ restart: printf("\n\n"); mime = 1; } else { - mime_get_boundary(); // #1 email body + mime = 2 + mime_get_boundary(); // 3 if boundary, 2 otherwise mime_binary = 1; - mime = 3; } } else if (!strncasecmp(writep, cte, 27)) { mime = 3; @@ -1209,6 +1208,8 @@ prompt_dl: mime_enc = ENC_SKIP; // Skip over binary MIME parts with no filename printf("\n"); } + } else if (mime == 2) { + mime = 2 + mime_get_boundary(); // 3 if boundary, 2 otherwise } readp = writep = NULL; } else if (mime == 4) { @@ -1805,6 +1806,7 @@ void get_email_body(struct emailhdrs *h, FILE *f, char mode) { mime_hasfile = 0; get_line(fp, 1, linebuf, LINEBUFSZ, &pos); // Reset buffer while (1) { + spinner(); if (!readp) readp = linebuf; if (!writep) @@ -1824,9 +1826,8 @@ void get_email_body(struct emailhdrs *h, FILE *f, char mode) { } else if (!strncmp(writep + 14, "text/html", 9)) { mime = 1; } else { - mime_get_boundary(); // #4 email body + mime = 2 + mime_get_boundary(); // 3 if boundary, 2 otherwise mime_binary = 1; - mime = 3; } } else if (!strncasecmp(writep, cte, 27)) { mime = 3; @@ -1841,6 +1842,8 @@ void get_email_body(struct emailhdrs *h, FILE *f, char mode) { mime = 4; if (mime_binary) mime_enc = ENC_SKIP; // Skip over binary MIME parts + } else if (mime == 2) { + mime = 2 + mime_get_boundary(); // 3 if boundary, 2 otherwise } readp = writep = NULL; } else if (mime == 4) {