On 2019/02/24 12:21, Landry Breuil wrote: > On Sun, Feb 24, 2019 at 10:02:08PM +1100, Stephen Gregoratto wrote: > > Ping for visibility. > > > > I've been using this update on two machines for about a week now, and > > there seems to be no loss in functionality/performance. > > > > Comments, OKs? > > Seems to work fine for me with my ruleset on 6.4. Nicholas, any opinion > ? since you're upstream...
I'd consider switching the port to use PCRE (diff below): : %%% Should I use PCRE or standard POSIX regexps? What's the difference? : : PCRE is a library providing "perl-compatible" regexps. These are broadly : compatible with POSIX extended regexps, but with a number of extensions based : on perl regexps. : : Unless you want or need some of the extensions, there is generally no : compelling reason to choose one over the other. PCRE is faster than some : POSIX regexp implementations, but few rulesets will include sufficient : regexps for this to make any difference. PCRE has had some security : problems, but most regexp implementations pose a similar risk for their : complexity if nothing else; fdm performs regexp matching as non-root in : any case. : : The Debian package and FreeBSD port both use PCRE by default. : : Because I hate maintaining and testing two sets of code, there is a strong : possibility that PCRE may become the fdm default at some point. OK sthen@ either way though. 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 24 Feb 2019 13:10:08 -0000 @@ -2,8 +2,7 @@ COMMENT= fetch, filter and deliver mail -V= 1.9 -REVISION = 0 +V= 2.0 DISTNAME= fdm-$V CATEGORIES= mail @@ -12,13 +11,15 @@ MAINTAINER= Nicholas Marriott <nicm@open # BSD PERMIT_PACKAGE_CDROM= Yes -WANTLIB= c crypto ssl z tdb>=3.0 +WANTLIB= c crypto pcre ssl z tdb>=3.0 MASTER_SITES= https://github.com/nicm/fdm/releases/download/$V/ -LIB_DEPENDS += databases/tdb>=1.2.7 +LIB_DEPENDS += databases/tdb>=1.2.7 \ + devel/pcre CONFIGURE_STYLE = gnu +CONFIGURE_ARGS = --enable-pcre post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/fdm 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 24 Feb 2019 13:10:08 -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; - }