EMAIL: Bug fix to MIME handling. Make '8bit' an alias for '7bit'.

This commit is contained in:
Bobbi Webber-Manners 2020-09-13 01:44:53 -04:00
parent ee19a796f6
commit 03924c1dcb

View File

@ -930,13 +930,13 @@ void email_pager(struct emailhdrs *h) {
}
pos = h->skipbytes;
fseek(fp, pos, SEEK_SET); // Skip over headers
mime_enc = ENC_7BIT;
restart:
eof = 0;
linecount = 0;
readp = linebuf;
writep = linebuf;
attachfp = NULL;
mime_enc = ENC_7BIT;
mime_binary = 0;
mime_hasfile = 0;
attnum = 0;
@ -956,14 +956,20 @@ restart:
printfield(h->date, 0, 39);
fputs("\nFrom: ", stdout);
printfield(h->from, 0, 70);
fputs("\nTo: ", stdout);
printfield(h->to, 0, 70);
if (h->cc[0] != '\0') {
if (strncmp(h->to, "News:", 5) == 0)
if (strncmp(h->to, "News:", 5) == 0) {
fputs("\nNewsgrp: ", stdout);
printfield(&(h->to[5]), 0, 70);
if (h->cc[0] != '\0') {
fputs("\nOrg: ", stdout);
else
printfield(h->cc, 0, 70);
}
} else {
fputs("\nTo: ", stdout);
printfield(h->to, 0, 70);
if (h->cc[0] != '\0') {
fputs("\nCC: ", stdout);
printfield(h->cc, 0, 70);
printfield(h->cc, 0, 70);
}
}
fputs("\nSubject: ", stdout);
printfield(h->subject, 0, 70);
@ -1014,6 +1020,8 @@ restart:
mime = 3;
if (!strncmp(writep + 27, "7bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(writep + 27, "8bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(writep + 27, "quoted-printable", 16))
mime_enc = ENC_QP;
else if (!strncmp(writep + 27, "base64", 6))
@ -1166,6 +1174,8 @@ retry:
mime = 4;
if (!strncmp(linebuf + 27, "7bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(linebuf + 27, "8bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(linebuf + 27, "quoted-printable", 16))
mime_enc = ENC_QP;
else if (!strncmp(linebuf + 27, "base64", 6))
@ -1567,6 +1577,8 @@ void get_email_body(struct emailhdrs *h, FILE *f, char mode) {
mime = 4;
if (!strncmp(linebuf + 27, "7bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(linebuf + 27, "8bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(linebuf + 27, "quoted-printable", 16))
mime_enc = ENC_QP;
else if (!strncmp(linebuf + 27, "base64", 6))
@ -1612,6 +1624,8 @@ void get_email_body(struct emailhdrs *h, FILE *f, char mode) {
mime = 3;
if (!strncmp(writep + 27, "7bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(writep + 27, "8bit", 4))
mime_enc = ENC_7BIT;
else if (!strncmp(writep + 27, "quoted-printable", 16))
mime_enc = ENC_QP;
else if (!strncmp(writep + 27, "base64", 6))