Index: head/mail/milter-regex/Makefile =================================================================== --- head/mail/milter-regex/Makefile (revision 500678) +++ head/mail/milter-regex/Makefile (revision 500679) @@ -1,44 +1,44 @@ # Created by: trevor # $FreeBSD$ PORTNAME= milter-regex -PORTVERSION= 2.4 +PORTVERSION= 2.6 CATEGORIES= mail 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 500678) +++ head/mail/milter-regex/distinfo (revision 500679) @@ -1,3 +1,3 @@ -TIMESTAMP = 1554320086 -SHA256 (milter-regex-2.4.tar.gz) = e6cafefa4d9f103a7b831afb8a0e99a3b8436be4367be6da3d0df5dad5429df9 -SIZE (milter-regex-2.4.tar.gz) = 20347 +TIMESTAMP = 1556518633 +SHA256 (milter-regex-2.6.tar.gz) = 1dc52b9e52ea896fd494c6429ac1c5cd3a631d1354de04ff295ffc8fcce3efc9 +SIZE (milter-regex-2.6.tar.gz) = 20517 Index: head/mail/milter-regex/files/patch-milter-regex.8 =================================================================== --- head/mail/milter-regex/files/patch-milter-regex.8 (revision 500678) +++ head/mail/milter-regex/files/patch-milter-regex.8 (nonexistent) @@ -1,27 +0,0 @@ ---- milter-regex.8.orig 2019-04-02 15:47:26 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 f Ar facility - .Op Fl j Ar dirname - .Op Fl l Ar loglevel -@@ -59,9 +61,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 f Ar facility - Use the specified syslog facility instead of the default, daemon. - .It Fl j Ar dirname Property changes on: head/mail/milter-regex/files/patch-milter-regex.8 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/milter-regex/files/patch-milter-regex.c =================================================================== --- head/mail/milter-regex/files/patch-milter-regex.c (revision 500678) +++ head/mail/milter-regex/files/patch-milter-regex.c (nonexistent) @@ -1,82 +0,0 @@ ---- milter-regex.c.orig 2019-04-02 15:47:26 UTC -+++ milter-regex.c -@@ -62,6 +62,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; - -@@ -99,6 +100,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" -@@ -647,6 +649,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, -@@ -685,6 +690,7 @@ main(int argc, char **argv) - { - 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; -@@ -693,8 +699,10 @@ main(int argc, char **argv) - const char *puser = NULL; - mode_t pperm = 0600; - int facility = LOG_DAEMON; -+ pid_t pid; -+ FILE *pid_fd = NULL; - -- while ((ch = getopt(argc, argv, "c:df:j:l:m:p:u:G:P:U:")) != -1) { -+ while ((ch = getopt(argc, argv, "c:df:j:l:m:p:qr:u:G:P:U:")) != -1) { - switch (ch) { - case 'c': - rule_file_name = optarg; -@@ -724,6 +732,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; -@@ -845,6 +859,20 @@ main(int argc, char **argv) - } - - 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"); Property changes on: head/mail/milter-regex/files/patch-milter-regex.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/milter-regex/files/COPYRIGHT =================================================================== --- head/mail/milter-regex/files/COPYRIGHT (revision 500678) +++ head/mail/milter-regex/files/COPYRIGHT (revision 500679) @@ -1,29 +1,29 @@ /* - * Copyright (c) 2003-2006 Daniel Hartmeier + * Copyright (c) 2003-2019 Daniel Hartmeier * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ Index: head/mail/milter-regex/files/milterregex.in =================================================================== --- head/mail/milter-regex/files/milterregex.in (revision 500678) +++ head/mail/milter-regex/files/milterregex.in (revision 500679) @@ -1,39 +1,40 @@ #!/bin/sh # $FreeBSD$ # Start or stop milterregex # PROVIDE: milterregex # REQUIRE: DAEMON # BEFORE: mail # KEYWORD: shutdown spooldir=%%SPOOLDIR%% # Define these milterregex_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/milterregex # # DO NOT CHANGE THESE DEFAULT VALUES HERE # # milterregex_flags Flags to milter-regex program [ -z "$milterregex_enable" ] && milterregex_enable="NO" # Enable milter-regex . /etc/rc.subr name="milterregex" rcvar="milterregex_enable" command="%%PREFIX%%/libexec/milter-regex" pidfile="${spooldir}/milter-regex.pid" required_files="%%PREFIX%%/etc/milter-regex.conf" stop_postcmd="milterregex_poststop" +command_args="-r ${pidfile}" milterregex_poststop() { /bin/rm -f ${pidfile} } load_rc_config $name run_rc_command "$1" Index: head/mail/milter-regex/pkg-descr =================================================================== --- head/mail/milter-regex/pkg-descr (revision 500678) +++ head/mail/milter-regex/pkg-descr (revision 500679) @@ -1,16 +1,10 @@ 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 program is developed on OpenBSD by the author. -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 +Copyright (c) 2003-2019 Daniel Hartmeier WWW: https://www.benzedrine.ch/milter-regex.html