new port of the milter-regex plugin for sendmail

Obtained from:	the OpenBSD port by Daniel Hartmeier (author of
		milter-regex)
This commit is contained in:
Trevor Johnson 2003-10-04 16:03:17 +00:00
parent e6fa52ae20
commit 58c62615af
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=90254
6 changed files with 141 additions and 0 deletions

View File

@ -152,6 +152,7 @@
SUBDIR += mew2-emacs20
SUBDIR += mew2-xemacs21
SUBDIR += mew2-xemacs21-mule
SUBDIR += milter-regex
SUBDIR += milter-sender
SUBDIR += mimedefang
SUBDIR += mini_sendmail

View File

@ -0,0 +1,40 @@
# New ports collection makefile for: milter-regex
# Date created: 2003-10-03
# Whom: trevor
#
# based on the OpenBSD port by Daniel Hartmeier (dhartmei on OpenBSD.org)
# $FreeBSD$
#
PORTNAME= milter_regex
PORTVERSION= 0.5
CATEGORIES= mail
MASTER_SITES= http://www.benzedrine.cx/
DISTNAME= milter-regex-${PORTVERSION}
MAINTAINER= trevor@FreeBSD.org
COMMENT= "Milter plugin to sendmail for regular expression filtering"
MAN8= milter-regex.8
PLIST= ${WRKDIR}/pkg-plist
USE_PERL5= yes
pre-everything::
.if !exists(/usr/lib/libmilter.a)
${ECHO_CMD} "Fatal: milter required, see instructions in DESCR"
exit 1
.endif
post-patch:
${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.orig
${SED} -E "s:-I/usr/src/gnu/usr.sbin/sendmail/include:${PTHREAD_CFLAGS}:g;s:-lpthread:${PTHREAD_LIBS}:g" < ${WRKSRC}/Makefile.orig > ${WRKSRC}/Makefile
pre-install:
${ECHO_CMD} libexec/milter-regex > ${PLIST}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/milter-regex ${PREFIX}/libexec
${INSTALL_MAN} ${WRKSRC}/milter-regex.8 ${PREFIX}/man/man8
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (milter-regex-0.5.tar.gz) = 58a53f79d2d09dfd0a9f895103f780af

View File

@ -0,0 +1,32 @@
$FreeBSD$
We lack OpenBSD's re-entrant logging functions.
--- milter-regex.c.orig Sat Sep 27 16:58:48 2003
+++ milter-regex.c Fri Oct 3 23:11:00 2003
@@ -54,7 +54,6 @@
static const char *rule_file_name = "/etc/milter-regex.conf";
static struct ruleset ruleset;
static int debug = 0;
-static struct syslog_data sdata = SYSLOG_DATA_INIT;
static sfsistat cb_connect(SMFICTX *ctx, char *name, _SOCK_ADDR *sa);
static sfsistat cb_helo(SMFICTX *ctx, char *arg);
@@ -378,7 +377,7 @@
if (vasprintf(&msg, fmt, ap) != -1) {
if (debug)
printf("%s\n", msg);
- syslog_r(priority, &sdata, "%s", msg);
+ syslog(priority, "%s", msg);
free(msg);
}
va_end(ap);
@@ -411,7 +413,7 @@
sfsistat r = MI_FAILURE;
tzset();
- openlog_r("milter-regex", LOG_PID | LOG_NDELAY, LOG_DAEMON, &sdata);
+ openlog("milter-regex", LOG_PID | LOG_NDELAY, LOG_DAEMON);
while ((ch = getopt(argc, argv, "dc:p:")) != -1) {
switch (ch) {

View File

@ -0,0 +1,17 @@
from the OpenBSD port:
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.
This port is in an experimental, untested state on FreeBSD. Please tell the
maintainer, trevor@FreeBSD.org, about your results, whether successful or
unsuccessful.
WWW: http://www.benzedrine.cx/milter-regex.html

View File

@ -0,0 +1,50 @@
#! /bin/sh
# $OpenBSD$
#
# Pre/post-installation setup of milter-regex
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
do_notice()
{
echo
echo "+---------------"
echo "| milter-regex has been installed as $PREFIX/libexec/milter-regex."
echo "| See milter-regex(8) for instructions on how to register the plugin."
echo "|"
echo "| To start the plugin automatically on startup, one can use:"
echo "|"
echo "| /etc/rc.conf.local"
echo "| milter_regex=YES"
echo "|"
echo "| /etc/rc.local"
echo "| if [ X\"\${milter_regex}\" == X\"YES\" -a \\"
echo "| -x $PREFIX/libexec/milter-regex ]; then"
echo "| echo -n ' milter-regex'"
echo "| $PREFIX/libexec/milter-regex"
echo "| fi"
echo "|"
echo "+---------------"
echo
}
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
case $2 in
PRE-INSTALL)
;;
POST-INSTALL)
do_notice
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0