From 4496e9a201b5dfc882e5e3aeadacbbbe44c568aa Mon Sep 17 00:00:00 2001 From: "Steffen (Daode) Nurpmeso" Date: Sat, 17 Sep 2016 21:44:08 +0200 Subject: [PATCH] Many: drop support for *mbox-rfc4155* - a no-brainer.. Because we do not reencode anything when we copy or save etc., we will always have to take care for non-RFC 4155. Sigh --- fio.c | 2 +- head.c | 15 ++++++++++----- maildir.c | 2 +- nail.1 | 32 -------------------------------- nail.h | 1 - 5 files changed, 12 insertions(+), 40 deletions(-) diff --git a/fio.c b/fio.c index 28bfb9f5b..74e5bb5de 100644 --- a/fio.c +++ b/fio.c @@ -297,7 +297,7 @@ setptr(FILE *ibuf, off_t offset) } if (linebuf[cnt - 1] == '\n') linebuf[cnt - 1] = '\0'; - if (maybe && linebuf[0] == 'F' && is_head(linebuf, cnt, FAL0)) { + if (maybe && linebuf[0] == 'F' && is_head(linebuf, cnt, TRU1)) { /* TODO char date[FROM_DATEBUF]; * TODO extract_date_from_from_(linebuf, cnt, date); * TODO self.m_time = 10000; */ diff --git a/head.c b/head.c index c681d5f4f..67c2fb53f 100644 --- a/head.c +++ b/head.c @@ -662,8 +662,7 @@ is_head(char const *linebuf, size_t linelen, bool_t compat) int rv; NYD2_ENTER; - if ((rv = (linelen >= 5 && !strncmp(linebuf, "From ", 5))) && - (!compat || ok_blook(mbox_rfc4155))) + if ((rv = (linelen >= 5 && !memcmp(linebuf, "From ", 5))) && !compat) rv = (extract_date_from_from_(linebuf, linelen, date) && _is_date(date)); NYD2_LEAVE; return rv; @@ -693,12 +692,18 @@ extract_date_from_from_(char const *line, size_t linelen, /* It seems there are invalid MBOX archives in the wild, compare * . http://bugs.debian.org/624111 * . [Mutt] #3868: mutt should error if the imported mailbox is invalid - * What they do is that they obfuscate the address to "name at host". - * I think we should handle that */ + * What they do is that they obfuscate the address to "name at host", + * and even "name at host dot dom dot dom. I think we should handle that */ else if(cp[0] == 'a' && cp[1] == 't' && cp[2] == ' '){ - cp = _from__skipword(cp += 3); + cp += 3; +jat_dot: + cp = _from__skipword(cp); if (cp == NULL) goto jerr; + if(cp[0] == 'd' && cp[1] == 'o' && cp[2] == 't' && cp[3] == ' '){ + cp += 4; + goto jat_dot; + } } linelen -= PTR2SIZE(cp - line); diff --git a/maildir.c b/maildir.c index c858e7047..6df8a4789 100644 --- a/maildir.c +++ b/maildir.c @@ -893,7 +893,7 @@ maildir_append(char const *name, FILE *fp, long offset) if (bp == NULL || ((state & (_INHEAD | _NLSEP)) == _NLSEP && - is_head(buf, buflen, FAL0))) { + is_head(buf, buflen, TRU1))) { if (off1 != (off_t)-1) { if ((rv = maildir_append1(name, fp, off1, size, flag)) == STOP) goto jfree; diff --git a/nail.1 b/nail.1 index b36bef736..1de472155 100644 --- a/nail.1 +++ b/nail.1 @@ -3665,9 +3665,6 @@ as necessary a privilege-separated dotlock child process will be used to accommodate for necessary privilege adjustments in order to create the dotlock file in the same directory and with the same user and group identities as the file of interest. -Also see -.Va mbox-rfc4155 -for fine-tuning the handling of MBOX files. .Pp If .Ar name @@ -6779,35 +6776,6 @@ it just causes messages to be marked in the header summary, and makes them specially addressable. . .Mx -.It Va mbox-rfc4155 -\*(BO \*(UA generates and expects RFC 4155 compliant MBOX text -mailboxes. -(With the restriction that RFC 4155 defines seven-bit clean data -storage, but which can be overwritten by a contrary setting of -.Va encoding ) . -Messages which are fetched over the network or from within already -existing Maildir (or any non-MBOX) mailboxes may require so-called -.Ql From_ -quoting (insertion of additional -.Ql > -characters to prevent line content misinterpretation) to be applied in -order to be storable in MBOX mailboxes, however, dependent on the -circumspection of the message producer. -E.g., \*(UA itself will, when newly generating messages, choose a -.Pf Content-Transfer- Va encoding -that prevents the necessity for such quoting \(en a necessary -precondition to ensure message checksums won't change. -.Pp -By default \*(UA will perform this -.Ql From_ -quoting in a way that results in a MBOX file that is compatible with -the POSIX MBOX layout, which means that, in order not to exceed the -capabilities of simple applications, many more -.Ql From_ -lines get quoted (thus modified) than necessary according to RFC 4155. -Set this option to instead generate MBOX files which comply to RFC 4155. -. -.Mx .It Va memdebug \*(BO Internal development variable. . diff --git a/nail.h b/nail.h index 7d1d28447..0b1fdf662 100644 --- a/nail.h +++ b/nail.h @@ -1528,7 +1528,6 @@ ok_b_emptybox, ok_v_MAILRC, /* {import=1,defval=VAL_MAILRC} */ ok_v_MBOX, /* {env=1,defval=VAL_MBOX} */ ok_b_markanswered, - ok_b_mbox_rfc4155, ok_b_memdebug, /* {vip=1} */ ok_b_message_id_disable, ok_v_message_inject_head, -- 2.11.4.GIT