Date: Tue, 09 Jun 2009 08:17:15 +0900 From: Hirohisa Yamaguchi <umq@ueo.co.jp> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/135393: [new port] mail/batv-milter 0.5.0 Message-ID: <864ouqfh8k.wl%umq@ueo.co.jp> Resent-Message-ID: <200906082320.n58NK3gQ090716@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 135393 >Category: ports >Synopsis: [new port] mail/batv-milter 0.5.0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jun 08 23:20:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Hirohisa Yamaguchi >Release: FreeBSD 8.0-CURRENT amd64 >Organization: <organization of PR author (multiple lines)> >Environment: System: FreeBSD calliope.****.org 8.0-CURRENT FreeBSD 8.0-CURRENT #20: Wed Apr 29 14:09:02 JST 2009 root@calliope.****.org:/usr/obj/usr/src/sys/CALLIOPE64 amd64 >Description: batv-milter is a milter implementation of BATV(Bounce Address Tag Validation). WWW: https://sourceforge.net/projects/batv-milter/ >How-To-Repeat: N/A >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # mail/batv-milter # mail/batv-milter/pkg-descr # mail/batv-milter/Makefile # mail/batv-milter/distinfo # mail/batv-milter/files # mail/batv-milter/files/milter-batv.sh.in # mail/batv-milter/files/patch-batv-filter_batv-filter.c # mail/batv-milter/files/patch-batv-filter_util.c # mail/batv-milter/files/patch-batv-filter_config.c # mail/batv-milter/files/site.config.m4 # mail/batv-milter/files/patch-batv-filter_Makefile.m4 # echo c - mail/batv-milter mkdir -p mail/batv-milter > /dev/null 2>&1 echo x - mail/batv-milter/pkg-descr sed 's/^X//' >mail/batv-milter/pkg-descr << 'bd1c04c08ffc4ffdaf2495aff207f379' XThis package is an implementation of BATV (Bounce Address Tag Validation), Xa draft proposal for detecting and messages making fraudulent use of a sender Xaddress. The filter is written as a plugin to Sendmail or other filters using Xthe milter API. X XWWW: https://sourceforge.net/projects/batv-milter/ bd1c04c08ffc4ffdaf2495aff207f379 echo x - mail/batv-milter/Makefile sed 's/^X//' >mail/batv-milter/Makefile << '00f0ef8c5c1f6fecb7cd9caa2b0e602d' X# New ports collection makefile for: batv-milter X# Date created: 2009-06-04 X# Whom: Hirohisa Yamaguchi <umq@ueo.co.jp> X# X# $FreeBSD$ X# X XPORTNAME= batv-milter XPORTVERSION= 0.5.0 XCATEGORIES= mail XMASTER_SITES= SF X XMAINTAINER= umq@ueo.co.jp XCOMMENT= A milter for BATV (Bounce Address Tag Validation) X XUSE_RC_SUBR= milter-batv.sh XUSE_OPENSSL= TRUE X XSUB_FILES= milter-batv.sh XWCONF= ${WRKSRC}/devtools/Site XMAN8= batv-filter.8 XPLIST_FILES= bin/batv-filter XPORTDOCS= INSTALL KNOWNBUGS LICENSE README RELEASE_NOTES \ X draft-levine-smtp-batv-01.txt X XSITE= ${FILESDIR}/site.config.m4 XSITE_SUB= -e "s|%%PREFIX%%|${PREFIX}|g" \ X -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \ X -e "s|%%OPENSSLINC%%|${OPENSSLINC}|g" \ X -e "s|%%OPENSSLLIB%%|${OPENSSLLIB}|g" X X.include <bsd.port.pre.mk> X.include "${PORTSDIR}/mail/sendmail/bsd.milter.mk" X X.if defined(WITH_DEBUG) XSITE_SUB+= -e '\|confOPTIMIZE.*-g|s/^dnl //g' X.endif X Xpre-configure: X ${SED} ${SITE_SUB} -e '\|^dnl |d' -e '/^dnl$$/d' \ X ${SITE} > ${WCONF}/site.config.m4 X Xpost-install: X.if !defined(WITH_DEBUG) X @${STRIP_CMD} ${PREFIX}/bin/batv-filter X.endif X.for i in ${MAN8} X @${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz X ${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8/ X.endfor X.if !defined(NOPORTDOCS) X ${MKDIR} ${DOCSDIR} X.for f in ${PORTDOCS} X ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} X.endfor X.endif X X.include <bsd.port.post.mk> 00f0ef8c5c1f6fecb7cd9caa2b0e602d echo x - mail/batv-milter/distinfo sed 's/^X//' >mail/batv-milter/distinfo << '085873b7f39391861720343f5f271ecb' XMD5 (batv-milter-0.5.0.tar.gz) = 644528b24a2e394472f8b96110e817e2 XSHA256 (batv-milter-0.5.0.tar.gz) = 1a40129d2585a4fe108401bfa577a8d9e2b7e295b2b0aa11e7f43dac7c601d3b XSIZE (batv-milter-0.5.0.tar.gz) = 275862 085873b7f39391861720343f5f271ecb echo c - mail/batv-milter/files mkdir -p mail/batv-milter/files > /dev/null 2>&1 echo x - mail/batv-milter/files/milter-batv.sh.in sed 's/^X//' >mail/batv-milter/files/milter-batv.sh.in << '28039f808fe6934082b1c774b5382689' X#!/bin/sh X# X# $FreeBSD: ports/mail/batv-milter/files/milter-batv.sh.in,v 1.17 2009/02/07 15:56:03 stefan Exp $ X# X X# PROVIDE: milter-batv X# REQUIRE: DAEMON X# BEFORE: mail X# KEYWORD: shutdown X X# Define these milterbatv_* variables in one of these files: X# /etc/rc.conf X# /etc/rc.conf.local X# /etc/rc.conf.d/milterbatv X# X# milterbatv_enable (bool): Set to "NO" by default. X# Set it to "YES" to enable batv-milter X# milterbatv_uid (str): Set username to run milter. X# milterbatv_profiles (list): Set to "" by default. X# Define your profiles here. X# milterbatv_cfgfile (str): Configuration file. X# X# milterbatv_${profile}_* : Variables per profile. X# Sockets must be different from each other. X# X# all parameters below can be set in batv-filter.conf(5). X# milterbatv_socket (str): Path to the milter socket. X# milterbatv_domain (str): Domainpart of From: in mails to sign. X# milterbatv_allowlist (str): Path to the allow list file. X# milterbatv_key (str): Path to the private key file to sign with. X# milterbatv_flags (str): Flags passed to start command. X X. %%RC_SUBR%% X Xname="milterbatv" Xrcvar=`set_rcvar` X Xstart_precmd="batv_prepcmd" Xstop_postcmd="batv_postcmd" Xcommand="%%PREFIX%%/bin/batv-filter" X_piddir="/var/run/milterbatv" Xpidfile="${_piddir}/pid" X Xload_rc_config $name X X# X# DO NOT CHANGE THESE DEFAULT VALUES HERE X# X: ${milterbatv_enable="NO"} X: ${milterbatv_uid="mailnull"} X: ${milterbatv_profiles=""} X: ${milterbatv_cfgfile="%%PREFIX%%/etc/mail/batv-filter.conf"} X X: ${milterbatv_socket=""} X: ${milterbatv_domain=""} X: ${milterbatv_allowlist=""} X: ${milterbatv_key=""} X# Options other than above can be set with $milterbatv_flags. X# see batv-milter documentation for detail. X: ${milterbatv_flags=""} X Xif [ -n "$2" ]; then X profile="$2" X if [ "x${milterbatv_profiles}" != "x" ]; then X pidfile="${_piddir}/${profile}.pid" X eval milterbatv_enable="\${milterbatv_${profile}_enable:-${milterbatv_enable}}" X eval milterbatv_socket="\${milterbatv_${profile}_socket:-}" X if [ "x${milterbatv_socket}" = "x" ];then X echo "You must define a socket (milterbatv_${profile}_socket)" X exit 1 X fi X eval milterbatv_cfgfile="\${milterbatv_${profile}_cfgfile:-${milterbatv_cfgfile}}" X eval milterbatv_domain="\${milterbatv_${profile}_domain:-${milterbatv_domain}}" X eval milterbatv_allowlist="\${milterbatv_${profile}_allowlist:-${milterbatv_allowlist}}" X eval milterbatv_key="\${milterbatv_${profile}_key:-${milterbatv_key}}" X eval milterbatv_flags="\${milterbatv_${profile}_flags:-${milterbatv_flags}}" X if [ -f "${milterbatv_cfgfile}" ];then X milterbatv_cfgfile="-x ${milterbatv_cfgfile}" X else X milterbatv_cfgfile="" X fi X if [ "x${milterbatv_socket}" != "x" ];then X _socket_prefix="-p" X fi X if [ "x${milterbatv_uid}" != "x" ];then X _uid_prefix="-u" X fi X if [ "x${milterbatv_domain}" != "x" ];then X milterbatv_domain="-d ${milterbatv_domain}" X fi X if [ "x${milterbatv_allowlist}" != "x" ];then X milterbatv_allowlist="-a ${milterbatv_allowlist}" X fi X if [ "x${milterbatv_key}" != "x" ];then X milterbatv_key="-k ${milterbatv_key}" X fi X command_args="-l ${_socket_prefix} ${milterbatv_socket} ${_uid_prefix} ${milterbatv_uid} -P ${pidfile} ${milterbatv_cfgfile} ${milterbatv_domain} ${milterbatv_allowlist} ${milterbatv_key}" X else X echo "$0: extra argument ignored" X fi Xelse X if [ "x${milterbatv_profiles}" != "x" -a "x$1" != "x" ]; then X if [ "x$1" != "xrestart" ]; then X for profile in ${milterbatv_profiles}; do X echo "===> milterbatv profile: ${profile}" X %%RC_SCRIPT%% $1 ${profile} X retcode="$?" X if [ "0${retcode}" -ne 0 ]; then X failed="${profile} (${retcode}) ${failed:-}" X else X success="${profile} ${success:-}" X fi X done X exit 0 X else X restart_precmd="" X fi X else X if [ -f "${milterbatv_cfgfile}" ];then X milterbatv_cfgfile="-x ${milterbatv_cfgfile}" X else X milterbatv_cfgfile="" X fi X if [ "x${milterbatv_socket}" != "x" ];then X _socket_prefix="-p" X fi X if [ "x${milterbatv_uid}" != "x" ];then X _uid_prefix="-u" X fi X if [ "x${milterbatv_domain}" != "x" ];then X milterbatv_domain="-d ${milterbatv_domain}" X fi X if [ "x${milterbatv_allowlist}" != "x" ];then X milterbatv_allowlist="-a ${milterbatv_allowlist}" X fi X if [ "x${milterbatv_key}" != "x" ];then X milterbatv_key="-k ${milterbatv_key}" X fi X command_args="-l ${_socket_prefix} ${milterbatv_socket} ${_uid_prefix} ${milterbatv_uid} -P ${pidfile} ${milterbatv_cfgfile} ${milterbatv_domain} ${milterbatv_allowlist} ${milterbatv_key}" X fi Xfi X Xbatv_prepcmd () X{ X if [ -S ${milterbatv_socket##local:} ] ; then X rm -f ${milterbatv_socket##local:} X elif [ -S ${milterbatv_socket##unix:} ] ; then X rm -f ${milterbatv_socket##unix:} X fi X if [ ! -d ${_piddir} ] ; then X mkdir -p ${_piddir} X fi X if [ -n "${milterbatv_uid}" ] ; then X chown ${milterbatv_uid} ${_piddir} X fi X} X Xbatv_postcmd() X{ X if [ -S ${milterbatv_socket##local:} ] ; then X rm -f ${milterbatv_socket##local:} X elif [ -S ${milterbatv_socket##unix:} ] ; then X rm -f ${milterbatv_socket##unix:} X fi X # just if the directory is empty X rmdir ${_piddir} > /dev/null 2>&1 X} X Xrun_rc_command "$1" 28039f808fe6934082b1c774b5382689 echo x - mail/batv-milter/files/patch-batv-filter_batv-filter.c sed 's/^X//' >mail/batv-milter/files/patch-batv-filter_batv-filter.c << 'e3f375bd80b754227a3d329d06d4e231' X--- ./batv-filter/batv-filter.c.orig 2009-05-28 01:16:45.000000000 +0900 X+++ ./batv-filter/batv-filter.c 2009-06-04 07:30:43.000000000 +0900 X@@ -53,7 +53,12 @@ X #include <openssl/sha.h> X X /* libsm includes */ X-#include <sm/string.h> X+#ifdef WITHOUT_SMSTRING X+# define sm_strlcat strlcat X+# define sm_strlcpy strlcpy X+#else /* WITHOUT_SMSTRING */ X+# include <sm/string.h> X+#endif /* WITHOUT_SMSTRING */ X X /* libmilter includes */ X #ifndef DEBUG X@@ -3461,10 +3466,11 @@ X pw = getpwnam(user); X if (pw == NULL) X { X+ char *q; X uid_t uid; X X- uid = atoi(user); X- if (uid != 0 && uid != LONG_MIN && uid != LONG_MAX) X+ uid = (uid_t) strtol(user, &q, 10); X+ if (*q == '\0') X pw = getpwuid(uid); X X if (pw == NULL) e3f375bd80b754227a3d329d06d4e231 echo x - mail/batv-milter/files/patch-batv-filter_util.c sed 's/^X//' >mail/batv-milter/files/patch-batv-filter_util.c << 'e2ddac052be113510490fdf76a4cb0d9' X--- ./batv-filter/util.c.orig 2009-05-28 01:16:45.000000000 +0900 X+++ ./batv-filter/util.c 2009-06-04 07:31:03.000000000 +0900 X@@ -25,7 +25,13 @@ X #include <ctype.h> X X /* libsm includes */ X-#include <sm/string.h> X+#ifdef WITHOUT_SMSTRING X+# define sm_strlcat strlcat X+# define sm_strlcpy strlcpy X+# include <sm/gen.h> X+#else /* WITHOUT_SMSTRING */ X+# include <sm/string.h> X+#endif /* WITHOUT_SMSTRING */ X X /* batv-filter includes */ X #include "batv-filter.h" e2ddac052be113510490fdf76a4cb0d9 echo x - mail/batv-milter/files/patch-batv-filter_config.c sed 's/^X//' >mail/batv-milter/files/patch-batv-filter_config.c << '6b06435e3ed6d099fc46a7cb6729ec59' X--- ./batv-filter/config.c.orig 2009-04-22 02:43:48.000000000 +0900 X+++ ./batv-filter/config.c 2009-06-04 07:30:43.000000000 +0900 X@@ -17,7 +17,12 @@ X #include <assert.h> X X /* libsm includes */ X-#include <sm/string.h> X+#ifdef WITHOUT_SMSTRING X+# define sm_strlcat strlcat X+# define sm_strlcpy strlcpy X+#else /* WITHOUT_SMSTRING */ X+# include <sm/string.h> X+#endif /* WITHOUT_SMSTRING */ X X /* dkim-filter includes */ X #include "config.h" 6b06435e3ed6d099fc46a7cb6729ec59 echo x - mail/batv-milter/files/site.config.m4 sed 's/^X//' >mail/batv-milter/files/site.config.m4 << 'e3bfccbe4584301f3ccb3b7482b48ff1' Xdefine(`confEBINDIR',`%%PREFIX%%/libexec') Xdefine(`confMANROOT',`%%PREFIX%%/man/man') Xdefine(`confMANROOTMAN',`%%PREFIX%%/man/man') Xdefine(`confUBINDIR',`%%PREFIX%%/bin') Xdefine(`confINCLUDEDIR',`%%PREFIX%%/include') Xdefine(`confLIBDIR',`%%PREFIX%%/lib') Xdefine(`confSHAREDLIBDIR',`%%PREFIX%%/lib') Xdefine(`confDONT_INSTALL_CATMAN',`True') XAPPENDDEF(`confLIBDIRS', `-L%%OPENSSLLIB%% ') XAPPENDDEF(`confINCDIRS', `-I%%OPENSSLINC%% ') Xdnl define(`confOPTIMIZE', `-g') e3bfccbe4584301f3ccb3b7482b48ff1 echo x - mail/batv-milter/files/patch-batv-filter_Makefile.m4 sed 's/^X//' >mail/batv-milter/files/patch-batv-filter_Makefile.m4 << '82fbb08ddae6f92190bf9c3c02685a8a' X--- ./batv-filter/Makefile.m4.orig 2009-04-24 06:11:09.000000000 +0900 X+++ ./batv-filter/Makefile.m4 2009-06-04 07:30:43.000000000 +0900 X@@ -3,6 +3,7 @@ X X define(`confMT', `TRUE') X define(`confREQUIRE_LIBSM', `true') X+define(`confENVDEF', `-DWITHOUT_SMSTRING ') X X APPENDDEF(`confLIBS', `-lssl -lcrypto') X dnl Enable and edit these paths as needed: X@@ -20,7 +21,7 @@ X bldPRODUCT_START(`executable', `batv-filter') X define(`bldSOURCES', `batv-filter.c config.c util.c ') X dnl PREPENDDEF(`confLIBS', ifelse(index(confENVDEF, `-DCOMMERCIAL'), -1, `-lmilter ', `../libmilter/libmilter.a ')) X-PREPENDDEF(`confLIBS', `../libmilter/libmilter.a ') X+PREPENDDEF(`confLIBS', `-lmilter ') X bldPRODUCT_END X X bldPRODUCT_START(`manpage', `batv-filter') 82fbb08ddae6f92190bf9c3c02685a8a exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?864ouqfh8k.wl%umq>