A new release of fdm, 2.0, was tagged five days ago. I've removed the fetch-mbox.c patch as it is incorporated in this release now.
Attached is the diff and the git-log for good measure. -- Stephen Gregoratto
Index: Makefile =================================================================== RCS file: /cvs/ports/mail/fdm/Makefile,v retrieving revision 1.21 diff -u -p -r1.21 Makefile --- Makefile 8 Mar 2016 17:30:43 -0000 1.21 +++ Makefile 16 Feb 2019 23:38:33 -0000 @@ -2,8 +2,7 @@ COMMENT= fetch, filter and deliver mail -V= 1.9 -REVISION = 0 +V= 2.0 DISTNAME= fdm-$V CATEGORIES= mail Index: distinfo =================================================================== RCS file: /cvs/ports/mail/fdm/distinfo,v retrieving revision 1.11 diff -u -p -r1.11 distinfo --- distinfo 3 Dec 2015 14:21:33 -0000 1.11 +++ distinfo 16 Feb 2019 23:38:33 -0000 @@ -1,2 +1,2 @@ -SHA256 (fdm-1.9.tar.gz) = FkFsOKmn4y0YciDMWuYaUUY9Xk5HQZxcUT9CJSPTmRQ= -SIZE (fdm-1.9.tar.gz) = 299916 +SHA256 (fdm-2.0.tar.gz) = BrKMtreSVwvGHX4psT0q9GuS/qd+BYsrF+Eej37QzqQ= +SIZE (fdm-2.0.tar.gz) = 313596 Index: patches/patch-fetch-mbox_c =================================================================== RCS file: patches/patch-fetch-mbox_c diff -N patches/patch-fetch-mbox_c --- patches/patch-fetch-mbox_c 8 Mar 2016 17:30:43 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@ -Fix a bug in mbox parser. - -Some tools only escape "From " lines in mboxs if they follow a blank line. fdm -would split at lines beginning "From " unconditionally. - -From upstream 91df796046ee2c36bccc9cfda27860b5bb9dd36d - -$OpenBSD: patch-fetch-mbox_c,v 1.1 2016/03/08 17:30:43 edd Exp $ ---- fetch-mbox.c.orig Fri Jun 5 19:30:34 2015 -+++ fetch-mbox.c Thu Feb 18 15:30:05 2016 -@@ -404,9 +404,9 @@ fetch_mbox_state_mail(struct account *a, struct fetch_ - struct mail *m = fctx->mail; - struct fetch_mbox_mbox *fmbox; - struct fetch_mbox_mail *aux; -- char *line, *ptr, *lptr; -- size_t llen; -- int flushing; -+ char *line, *ptr, *last_line, *lptr; -+ size_t llen, n; -+ int flushing, from; - - /* Find current mbox and check for EOF. */ - fmbox = ARRAY_ITEM(&data->fmboxes, data->index); -@@ -443,7 +443,7 @@ fetch_mbox_state_mail(struct account *a, struct fetch_ - * trimmed later with minimal penalty). - */ - flushing = 0; -- for (;;) { -+ for (last_line = NULL;; last_line = line) { - /* Check for EOF. */ - if (data->off == fmbox->size) { - aux->size = data->off - aux->off; -@@ -459,10 +459,27 @@ fetch_mbox_state_mail(struct account *a, struct fetch_ - } else - data->off += ptr - line + 1; - -- /* Check if the line is "From ". */ -- if (line > fmbox->base && -- ptr - line >= 5 && strncmp(line, "From ", 5) == 0) { -- /* End of mail. */ -+ /* -+ * Check if we have reached the end of this message at the next -+ * message's "From " line. To allow "From " inside message -+ * bodes, they can be escaped by prepending with '>'. Some -+ * tools escape all "From " lines; others only escape if they -+ * immediately follow a blank line. We accept only "From" lines -+ * which follow a blank line (\n or \r\n). -+ */ -+ from = 1; -+ if (line == fmbox->base || last_line == NULL) -+ from = 0; -+ else { -+ n = line - last_line; -+ if (n != 1 && n != 2) -+ from = 0; -+ else if (n == 1 && *last_line != '\n') -+ from = 0; -+ else if (n == 2 && memcmp(last_line, "\r\n", 2) != 0) -+ from = 0; -+ } -+ if (from && ptr - line >= 5 && memcmp(line, "From ", 5) == 0) { - aux->size = (line - fmbox->base) - aux->off; - break; - }
370b04f 2.0. a450cb8 Typo from larryhynes. dd68ebd Typo, from larryhynes. e066ef3 Mark parse.[ch] as BUILT_SOURCES, from Tomasz Miasko. cea573c Fix some warnings. dde4c36 Use SNI extension, from Tomasz Miasko in GitHub issue 50. 287530d Remove entry from list, from Christian Barthel. f90a5b0 DragonFlyBSD have suffered some sort of fit and removed MAXNAMLEN. GitHub issue 49 from Leonid Bobrov. bd21ac3 Mention $(), GitHub issue 48. 375ff24 Fix tdb URL, GitHub issue 47. eabdf3b Compat fixes from Rosen Penev. d2ad749 Do not use uninitialized cipher, reported by Gaetan Bisson. 3389b51 Spelling mistake; from larry hynes. cae4ea3 Document folder tag, from Tomasz Miasko. 070cee8 Look for OPENSSL_init_ssl, from Tomasz Miasko. dceda2c Do not remove newlines at the end of messages (preserve double newlines) in mboxes, from Martin Brandenburg. 17bb530 Save a tag mbox_from when reading from mbox files and use that tag when writing mbox files. From Martin Brandenburg. 71a3ff1 Use-after-free from Martin Brandenburg. 2031ca5 Minor MANUAL error, from cacatoes at tuxfamily dot org. b952bf6 Fix use-after-free reported by cacatoes at tuxfamily dot org. 41761f6 Clear wanted message list and committed count when switching IMAP folders. b924820 Disable insecure stuff that OpenSSL leaves enabled by default, and provide an insecure flag (which replaces no-tls1) to turn them on again. From gmp at wow.st. f9cef7d Always add a Received header, at start if no others. Also include some SSL information in the fdm Received header. From gmp at wow.st. 766fcf6 No more SF mail address. 622781e Apparently Google can reply with nothing for X-GM-*. Reported by Bryan Steele. 91df796 Handle From lines only after a blank line, from Edd Barrett. 68a95b4 Fetch GMail IMAP extensions and stick them in tags, from David Lazar. 0f6b52f Use AC_CHECK_DECL for strlcat, strlcpy since libressl has the symbols but no declarations, reported by Christian Neukirchen. 50b7bf8 Accept continuation without space, from Ross L Richards. eaf5ef5 Handle broken IMAP servers which will not accept a space before the {} length of a string following a continuation, reported by Ross L Richardson. 951e745 Add --enable-pcre, reported by Christian Neukirchen. d57796b Change SPLAY tree to RB. 6211301 Spaces to tabs.