1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

- update to 2.6

patches have been merged into upstream
This commit is contained in:
Dirk Meyer 2019-05-02 19:07:34 +00:00
parent 51189d4166
commit cf0df21e64
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=500679
7 changed files with 8 additions and 122 deletions

View File

@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= milter-regex
PORTVERSION= 2.4
PORTVERSION= 2.6
CATEGORIES= mail
MASTER_SITES= https://www.benzedrine.ch/

View File

@ -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

View File

@ -1,5 +1,5 @@
/*
* 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

View File

@ -30,6 +30,7 @@ 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}

View File

@ -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

View File

@ -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");

View File

@ -2,15 +2,9 @@ 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.
This program is developed on OpenBSD by the author.
LICENSE: BSD
Copyright (c) 2003-2006 Daniel Hartmeier
Copyright (c) 2003-2019 Daniel Hartmeier
WWW: https://www.benzedrine.ch/milter-regex.html