add milter support
fix startup script PR: 38297 Submitted by: Martin Matuska <matuska@wu-wien.ac.at>, maintainer
This commit is contained in:
parent
b1a862fa66
commit
4ddd030640
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=59477
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
PORTNAME= amavisd
|
PORTNAME= amavisd
|
||||||
PORTVERSION= 20020300
|
PORTVERSION= 20020300
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= security
|
CATEGORIES= security
|
||||||
MASTER_SITES= http://www.amavis.org/dist/perl/
|
MASTER_SITES= http://www.amavis.org/dist/perl/
|
||||||
DISTNAME= ${PORTNAME}-snapshot-${PORTVERSION}
|
DISTNAME= ${PORTNAME}-snapshot-${PORTVERSION}
|
||||||
@ -39,6 +39,8 @@ AMAVISGROUP?= vscan
|
|||||||
|
|
||||||
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc --with-amavisuser=${AMAVISUSER}:${AMAVISGROUP}
|
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc --with-amavisuser=${AMAVISUSER}:${AMAVISGROUP}
|
||||||
|
|
||||||
|
STARTSCRIPT= amavisd.sh
|
||||||
|
|
||||||
.if defined(WITH_POSTFIX)
|
.if defined(WITH_POSTFIX)
|
||||||
CONFIGURE_ARGS+= --enable-postfix
|
CONFIGURE_ARGS+= --enable-postfix
|
||||||
MTA?= postfix
|
MTA?= postfix
|
||||||
@ -47,19 +49,24 @@ RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
|
|||||||
CONFIGURE_ARGS+= --enable-postfix
|
CONFIGURE_ARGS+= --enable-postfix
|
||||||
MTA?= postfix
|
MTA?= postfix
|
||||||
RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
|
RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
|
||||||
|
.elif defined(WITH_MILTER)
|
||||||
|
CONFIGURE_ARGS+= --enable-milter
|
||||||
|
MTA?= milter
|
||||||
|
PLIST= ${PKGDIR}/pkg-plist.milter
|
||||||
|
STARTSCRIPT= amavisd-milter.sh
|
||||||
.else
|
.else
|
||||||
CONFIGURE_ARGS+= --enable-sendmail
|
CONFIGURE_ARGS+= --enable-sendmail
|
||||||
MTA?= sendmail
|
MTA?= sendmail
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
post-patch:
|
post-patch:
|
||||||
@${SED} 's,%%AMAVISUSER%%,${AMAVISUSER},g' ${FILESDIR}/amavisd.sh > ${WRKSRC}/amavisd.sh
|
@${SED} 's,%%AMAVISUSER%%,${AMAVISUSER},g' ${FILESDIR}/${STARTSCRIPT} > ${WRKSRC}/${STARTSCRIPT}
|
||||||
|
|
||||||
pre-install:
|
pre-install:
|
||||||
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${AMAVISUSER} ${AMAVISGROUP}
|
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${AMAVISUSER} ${AMAVISGROUP}
|
||||||
|
|
||||||
post-install:
|
post-install:
|
||||||
${INSTALL_SCRIPT} ${WRKSRC}/amavisd.sh ${PREFIX}/etc/rc.d
|
${INSTALL_SCRIPT} ${WRKSRC}/${STARTSCRIPT} ${PREFIX}/etc/rc.d
|
||||||
.if !defined(NOPORTDOCS)
|
.if !defined(NOPORTDOCS)
|
||||||
@${MKDIR} ${DOCSDIR}
|
@${MKDIR} ${DOCSDIR}
|
||||||
.for FILE in FAQ INSTALL README README.exim README.milter README.postfix README.qmail README.scanners README.sendmail doc/amavis.html doc/amavis.m4 doc/amavis.png doc/amavis.txt
|
.for FILE in FAQ INSTALL README README.exim README.milter README.postfix README.qmail README.scanners README.sendmail doc/amavis.html doc/amavis.m4 doc/amavis.png doc/amavis.txt
|
||||||
|
31
security/amavisd/files/amavisd-milter.sh
Normal file
31
security/amavisd/files/amavisd-milter.sh
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
|
||||||
|
echo "$0: Cannot determine the PREFIX" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
( [ -x ${PREFIX}/sbin/amavisd ] && [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
|
||||||
|
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
|
||||||
|
AMAVIS_MILTER=$(/bin/ps -xU %%AMAVISUSER%% | grep amavis-milter | awk '{ print $1 }')
|
||||||
|
( /bin/test "$AMAVISD" || /bin/test "$AMAVIS_MILTER" ) && \
|
||||||
|
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD $AMAVIS_MILTER" > /dev/null
|
||||||
|
rm -rf /var/amavis/amavis*.sock
|
||||||
|
su - %%AMAVISUSER%% -c "${PREFIX}/sbin/amavis-milter -D -p /var/amavis/amavis-milter.sock" > /dev/null
|
||||||
|
su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd-milter'
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
( [ -x ${PREFIX}/sbin/amavisd ] && [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
|
||||||
|
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
|
||||||
|
AMAVIS_MILTER=$(/bin/ps -xU %%AMAVISUSER%% | grep amavis-milter | awk '{ print $1 }')
|
||||||
|
( /bin/test "$AMAVISD" || /bin/test "$AMAVIS_MILTER" ) && \
|
||||||
|
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD $AMAVIS_MILTER" > /dev/null && echo -n ' amavisd-milter'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: `basename $0` {start|stop}" >&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
@ -7,10 +7,18 @@ fi
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
[ -x ${PREFIX}/sbin/amavisd ] && su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd'
|
( [ -x ${PREFIX}/sbin/amavisd ] && [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
|
||||||
|
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
|
||||||
|
( /bin/test "$AMAVISD" ) && \
|
||||||
|
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD" > /dev/null
|
||||||
|
rm -rf /var/amavis/amavis*.sock
|
||||||
|
su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd'
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n ' amavisd'
|
( [ -x ${PREFIX}/sbin/amavisd ] && [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
|
||||||
|
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
|
||||||
|
( /bin/test "$AMAVISD") && \
|
||||||
|
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD" > /dev/null && echo -n ' amavisd'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: `basename $0` {start|stop}" >&2
|
echo "Usage: `basename $0` {start|stop}" >&2
|
||||||
|
18
security/amavisd/pkg-plist.milter
Normal file
18
security/amavisd/pkg-plist.milter
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
%%PORTDOCS%%share/doc/amavisd/FAQ
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/INSTALL
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README.exim
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README.milter
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README.postfix
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README.qmail
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README.scanners
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/README.sendmail
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/amavis.html
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/amavis.m4
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/amavis.png
|
||||||
|
%%PORTDOCS%%share/doc/amavisd/amavis.txt
|
||||||
|
%%PORTDOCS%%@dirrm share/doc/amavisd
|
||||||
|
etc/amavisd.conf
|
||||||
|
etc/rc.d/amavisd-milter.sh
|
||||||
|
sbin/amavis-milter
|
||||||
|
sbin/amavisd
|
Loading…
Reference in New Issue
Block a user