Index: head/mail/opendmarc/Makefile =================================================================== --- head/mail/opendmarc/Makefile (revision 402718) +++ head/mail/opendmarc/Makefile (revision 402719) @@ -1,56 +1,56 @@ # Created by: Jaap Akkerhuis # $FreeBSD$ PORTNAME= opendmarc PORTVERSION= 1.3.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail security MASTER_SITES= SF/${PORTNAME} \ SF/${PORTNAME}/Previous%20Releases MAINTAINER= freebsd@gushi.org COMMENT= DMARC library and milter implementation LICENSE= BSD3CLAUSE SENDMAIL LICENSE_COMB= multi LICENSE_FILE_SENDMAIL= ${WRKSRC}/LICENSE.Sendmail LICENSE_GROUPS_SENDMAIL= FSF OSI LICENSE_NAME_SENDMAIL= Sendmail Open Source License LICENSE_PERMS_SENDMAIL= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept USES= libtool shebangfix USE_LDCONFIG= yes USE_RC_SUBR= opendmarc GNU_CONFIGURE= yes OPTIONS_DEFINE= SPF OPTIONS_DEFAULT= SPF SPF_DESC= Enable support for SPF record checking SPF_LIB_DEPENDS= libspf2.so:${PORTSDIR}/mail/libspf2 SPF_CONFIGURE_ON= --with-spf \ --with-spf2-include=${LOCALBASE}/include/spf2 \ --with-spf2-lib=${LOCALBASE}/lib SHEBANG_FILES= reports/opendmarc-expire.in \ reports/opendmarc-import.in \ reports/opendmarc-params.in \ reports/opendmarc-reports.in PORTDOCS= * .if !exists( /usr/include/libmilter/mfapi.h ) BUILD_DEPENDS+= ${LOCALBASE}/include/libmilter/mfapi.h:${PORTSDIR}/mail/sendmail CFLAGS+= -I${LOCALBASE}/include .endif post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/mail ${INSTALL_DATA} \ ${WRKSRC}/opendmarc/opendmarc.conf.sample ${STAGEDIR}${PREFIX}/etc/mail @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libopendmarc.so.2 .include Index: head/mail/opendmarc/files/opendmarc.in =================================================================== --- head/mail/opendmarc/files/opendmarc.in (revision 402718) +++ head/mail/opendmarc/files/opendmarc.in (revision 402719) @@ -1,34 +1,62 @@ #!/bin/sh # $FreeBSD$ # PROVIDE: opendmarc # REQUIRE: LOGIN # BEFORE: mail # KEYWORD: opendmarc # Define these opendmarc_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/opendmarc # # DO NOT CHANGE THESE DEFAULT VALUES HERE # . /etc/rc.subr name="opendmarc" rcvar=opendmarc_enable +start_precmd="dmarc_prepcmd" +stop_postcmd="dmarc_postcmd" command="%%PREFIX%%/sbin/opendmarc" +_piddir="/var/run/opendmarc" load_rc_config $name opendmarc_enable=${opendmarc_enable-"NO"} opendmarc_runas=${opendmarc_runas-"mailnull:mailnull"} -opendmarc_pidfile=${opendmarc_pidfile-"/var/run/opendmarc.pid"} +opendmarc_pidfile=${opendmarc_pidfile-"${_piddir}/pid"} +#opendmarc_socketspec=${opendmarc_socketspec-"local:${_piddir}/socket"} opendmarc_socketspec=${opendmarc_socketspec-"inet:8893@localhost"} opendmarc_cfgfile=${opendmarc_cfgfile-"%%PREFIX%%/etc/mail/opendmarc.conf"} opendmarc_flags=${opendmarc_flags-"-l -P $opendmarc_pidfile \ -c $opendmarc_cfgfile -p $opendmarc_socketspec -u $opendmarc_runas"} + +dmarc_prepcmd () +{ + if [ -S ${opendmarc_socketspec##local:} ] ; then + rm -f ${opendmarc_socketspec##local:} + elif [ -S ${opendmarc_socketspec##unix:} ] ; then + rm -f ${opendmarc_socketspec##unix:} + fi + if [ ! -d ${_piddir} ] ; then + mkdir -p ${_piddir} + fi + chown ${opendmarc_runas} ${_piddir} +} + +dmarc_postcmd() +{ + if [ -S ${opendmarc_socketspec##local:} ] ; then + rm -f ${opendmarc_socketspec##local:} + elif [ -S ${opendmarc_socketspec##unix:} ] ; then + rm -f ${opendmarc_socketspec##unix:} + fi + # just if the directory is empty + rmdir ${_piddir} > /dev/null 2>&1 +} run_rc_command "$1"