Index: head/mail/milter-regex/Makefile =================================================================== --- head/mail/milter-regex/Makefile (revision 489554) +++ head/mail/milter-regex/Makefile (revision 489555) @@ -1,45 +1,44 @@ # Created by: trevor # $FreeBSD$ PORTNAME= milter-regex -PORTVERSION= 2.0 -PORTREVISION= 4 +PORTVERSION= 2.2 CATEGORIES= mail -MASTER_SITES= http://www.benzedrine.cx/ +MASTER_SITES= https://www.benzedrine.ch/ MAINTAINER= dinoex@FreeBSD.org COMMENT= Milter plugin to sendmail for regular expression filtering LICENSE= BSD2CLAUSE LICENSE_FILE= ${FILESDIR}/COPYRIGHT USE_RC_SUBR= milterregex SUB_LIST= SPOOLDIR=${SPOOLDIR} PLIST_SUB= SPOOLDIR=${SPOOLDIR} MAILUSER?= mailnull SPOOLDIR?= /var/run/milter-regex .include .include "${PORTSDIR}/mail/sendmail/bsd.milter.mk" post-patch: ${REINPLACE_CMD} -e \ "s:/etc/milter-regex.conf:${PREFIX}/etc/milter-regex.conf:g; \ s:/var/spool/milter-regex:${SPOOLDIR}:g; \ s:_milter-regex:${MAILUSER}:g;" ${WRKSRC}/milter-regex.c ${REINPLACE_CMD} -e \ "s:/etc/milter-regex.conf:${PREFIX}/etc/milter-regex.conf:g; \ s:/var/spool/milter-regex:${SPOOLDIR}:g; \ s:mailstats 1:mailstats 8:;" ${WRKSRC}/milter-regex.8 ${REINPLACE_CMD} -e "s:-I/usr/src/gnu/usr.sbin/sendmail/include::g; \ s:-L/usr/local/lib:-L${LOCALBASE}/lib:g; \ s/-Werror//g" ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/milter-regex ${STAGEDIR}${PREFIX}/libexec/ ${INSTALL_MAN} ${WRKSRC}/milter-regex.8 ${STAGEDIR}${PREFIX}/man/man8/ ${MKDIR} ${STAGEDIR}${SPOOLDIR} .include Index: head/mail/milter-regex/distinfo =================================================================== --- head/mail/milter-regex/distinfo (revision 489554) +++ head/mail/milter-regex/distinfo (revision 489555) @@ -1,2 +1,3 @@ -SHA256 (milter-regex-2.0.tar.gz) = ac0388766e5780c42d39e72b694986524e312ea17e5da4823749c7c5b7a55a70 -SIZE (milter-regex-2.0.tar.gz) = 19891 +TIMESTAMP = 1546371034 +SHA256 (milter-regex-2.2.tar.gz) = 67b7cbe04be7aff111750648ea4004927de9c40c53959cab32101833e7ecccdd +SIZE (milter-regex-2.2.tar.gz) = 20496 Index: head/mail/milter-regex/files/patch-milter-regex.8 =================================================================== --- head/mail/milter-regex/files/patch-milter-regex.8 (revision 489554) +++ head/mail/milter-regex/files/patch-milter-regex.8 (revision 489555) @@ -1,27 +1,27 @@ ---- milter-regex.8.orig 2011-11-21 13:13:47.000000000 +0100 -+++ milter-regex.8 2011-12-10 07:52:00.000000000 +0100 +--- milter-regex.8.orig 2018-09-25 20:51:47 UTC ++++ milter-regex.8 @@ -36,7 +36,9 @@ .Sh SYNOPSIS .Nm .Op Fl d +.Op Fl q .Op Fl c Ar config +.Op Fl r Ar pid-file .Op Fl j Ar dirname - .Op Fl p Ar pipe - .Op Fl u Ar user -@@ -53,9 +55,14 @@ + .Op Fl l Ar loglevel + .Op Fl m Ar number +@@ -58,9 +60,14 @@ The options are as follows: .It Fl d Don't detach from controlling terminal and produce verbose debug output on stdout. +.It Fl q +Don't send to syslog messages with priority higher than LOG_NOTICE. .It Fl c Ar config Use the specified configuration file instead of the default, /etc/milter-regex.conf. +.It Fl r Ar pid-file +Use the specified pid file to write to. Default is: +/var/spool/milter-regex/milter-regex.pid .It Fl j Ar dirname Change root to the specified directory. - .It Fl p Ar pipe + .It Fl l Ar loglevel Index: head/mail/milter-regex/files/patch-milter-regex.c =================================================================== --- head/mail/milter-regex/files/patch-milter-regex.c (revision 489554) +++ head/mail/milter-regex/files/patch-milter-regex.c (revision 489555) @@ -1,86 +1,82 @@ ---- milter-regex.c.orig 2013-11-25 09:41:55.000000000 +0100 -+++ milter-regex.c 2013-11-27 05:25:43.000000000 +0100 -@@ -60,6 +60,7 @@ +--- milter-regex.c.orig 2018-09-25 20:31:25 UTC ++++ milter-regex.c +@@ -61,6 +61,7 @@ extern int parse_ruleset(const char *, static const char *rule_file_name = "/etc/milter-regex.conf"; static int debug = 0; +static int quiet = 0; static unsigned maxlines = 0; static pthread_mutex_t mutex; -@@ -97,6 +98,7 @@ +@@ -98,6 +99,7 @@ static void msg(int, struct context *, #define USER "_milter-regex" #define OCONN "unix:/var/spool/milter-regex/sock" +#define OPID "/var/spool/milter-regex/milter-regex.pid" #define RCODE_REJECT "554" #define RCODE_TEMPFAIL "451" #define XCODE_REJECT "5.7.1" -@@ -645,6 +647,9 @@ +@@ -646,6 +648,9 @@ msg(int priority, struct context *contex va_list ap; char msg[8192]; + if (LOG_PRI(priority) > LOG_INFO && quiet) + return; + va_start(ap, fmt); if (context != NULL) snprintf(msg, sizeof(msg), "%s [%s]: ", context->host_name, -@@ -682,15 +687,19 @@ +@@ -684,6 +689,7 @@ main(int argc, char **argv) { - int ch; + int ch, maskpri = LOG_INFO; const char *oconn = OCONN; + const char *pid_file_name = OPID; const char *user = USER; const char *jail = NULL; sfsistat r = MI_FAILURE; - const char *ofile = NULL; - +@@ -691,8 +697,10 @@ main(int argc, char **argv) + const char *pgroup = NULL; + const char *puser = NULL; + mode_t pperm = 0600; + pid_t pid; + FILE *pid_fd = NULL; -+ - tzset(); - openlog("milter-regex", LOG_PID | LOG_NDELAY, LOG_DAEMON); -- while ((ch = getopt(argc, argv, "c:dj:l:m:p:u:")) != -1) { -+ while ((ch = getopt(argc, argv, "c:dj:l:m:p:qr:u:")) != -1) { +- while ((ch = getopt(argc, argv, "c:dj:l:m:p:u:G:P:U:")) != -1) { ++ while ((ch = getopt(argc, argv, "c:dj:l:m:p:qr:u:G:P:U:")) != -1) { switch (ch) { case 'c': rule_file_name = optarg; -@@ -710,6 +719,12 @@ +@@ -712,6 +720,12 @@ main(int argc, char **argv) case 'p': oconn = optarg; break; + case 'q': + quiet = 1; + break; + case 'r': + pid_file_name = optarg; + break; case 'u': user = optarg; break; -@@ -782,9 +797,22 @@ - perror("daemon"); - goto done; +@@ -833,6 +847,20 @@ main(int argc, char **argv) } -- umask(0177); msg(LOG_INFO, NULL, "started: %s", rcsid); + + umask(0006); + + if((pid_fd = fopen(pid_file_name, "w")) == NULL) { + msg(LOG_ERR, NULL, "can't open file: %s", pid_file_name); + goto done; + } else { + pid = getpid(); + fprintf(pid_fd, "%d", (int) pid); + fclose(pid_fd); + } + + umask(0117); /* make socket group writeable */ + r = smfi_main(); if (r != MI_SUCCESS) msg(LOG_ERR, NULL, "smfi_main: terminating due to error"); Index: head/mail/milter-regex/pkg-descr =================================================================== --- head/mail/milter-regex/pkg-descr (revision 489554) +++ head/mail/milter-regex/pkg-descr (revision 489555) @@ -1,16 +1,16 @@ Milter-regex is a sendmail milter plugin that allows to reject mail based on regular expressions matching SMTP envelope parameters and mail headers and body. In order to build milter-regex, sendmail needs to be compiled with milter support, installing the libmilter library. This is the default for the sendmail in the base system. Some of the sendmail ports omit libmilter by default (SENDMAIL_WITHOUT_MILTER). This program is developed on OpenBSD by the maintainer. LICENSE: BSD Copyright (c) 2003-2006 Daniel Hartmeier -WWW: http://www.benzedrine.cx/milter-regex.html +WWW: https://www.benzedrine.ch/milter-regex.html