diff options
author | ijliao <ijliao@FreeBSD.org> | 2002-06-18 03:28:21 +0800 |
---|---|---|
committer | ijliao <ijliao@FreeBSD.org> | 2002-06-18 03:28:21 +0800 |
commit | 79432c42408de3e91ed8d62c12109ce54a6f4a22 (patch) | |
tree | 813827b69893eed32887da21d47e6c7014fd3d5d | |
parent | 348d8369e9f8ce01f03f72e6c12948b59f3b2bba (diff) | |
download | freebsd-ports-gnome-79432c42408de3e91ed8d62c12109ce54a6f4a22.tar.gz freebsd-ports-gnome-79432c42408de3e91ed8d62c12109ce54a6f4a22.tar.zst freebsd-ports-gnome-79432c42408de3e91ed8d62c12109ce54a6f4a22.zip |
add support for postfix and exim
PR: 32471
Submitted by: Martijn Lina <martijn@ietsvaags.xs4all.nl>, TAKEMURA Masahiro <mastake@msel.t.u-tokyo.ac.jp>
Tested by: TERAMOTO Masahiro <teramoto@comm.eng.osaka-u.ac.jp>, "Julian C. Dunn" <jdunn@aquezada.com>
Approved by: maintainer timeout (1 month since I mailed him)
-rw-r--r-- | security/amavis-perl/Makefile | 18 | ||||
-rw-r--r-- | security/amavis-perl/pkg-install.postfix | 31 | ||||
-rw-r--r-- | security/amavis-perl/pkg-message.postfix | 22 |
3 files changed, 68 insertions, 3 deletions
diff --git a/security/amavis-perl/Makefile b/security/amavis-perl/Makefile index 16eb61785cec..e6890d44f13c 100644 --- a/security/amavis-perl/Makefile +++ b/security/amavis-perl/Makefile @@ -50,7 +50,18 @@ BUILD_DEPENDS+= ${QMAIL_DIR}/bin/qmail-send:${PORTSDIR}/mail/qmail RUN_DEPENDS= ${BUILD_DEPENDS} .endif -.if !defined(MTA) +.if defined(MTA) +.if ${MTA} == "postfix" +DIROWNER?= vscan:daemon +CONFIGURE_ARGS+= --enable-postfix --enable-smtp +BUILD_DEPENDS+= ${LOCALBASE}/sbin/postfix:${PORTSDIR}/mail/postfix +.elif ${MTA} == "exim" +DIROWNER?= root:daemon +CONFIGURE_ARGS+= --enable-exim +BUILD_DEPENDS+= ${LOCALBASE}/sbin/exim:${PORTSDIR}/mail/exim +.endif +RUN_DEPENDS= ${BUILD_DEPENDS} +.else MTA?= sendmail DIROWNER?= root:daemon CONFIGURE_ARGS+= --enable-relay @@ -58,6 +69,7 @@ CONFIGURE_ARGS+= --enable-relay PKGDEINSTALL= ${PKGDIR}/pkg-deinstall.${MTA} PKGINSTALL= ${PKGDIR}/pkg-install.${MTA} +PKGMESSAGE= ${PKGDIR}/pkg-message.${MTA} do-install: @${MKDIR} /var/log/amavis @@ -71,9 +83,9 @@ do-install: .endif post-install: + @PKG_PREFIX=${PREFIX} ${PERL5} ${PKGINSTALL} _ POST-INSTALL @${CHOWN} ${DIROWNER} /var/log/amavis /var/spool/quarantine @${CHMOD} 0755 /var/log/amavis /var/spool/quarantine - @PKG_PREFIX=${PREFIX} ${PERL5} ${PKGINSTALL} _ POST-INSTALL - @${CAT} ${PKGMESSAGE}.${MTA} + @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/security/amavis-perl/pkg-install.postfix b/security/amavis-perl/pkg-install.postfix new file mode 100644 index 000000000000..ec1f8247c75e --- /dev/null +++ b/security/amavis-perl/pkg-install.postfix @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +$user=vscan; +$group=nogroup; + +if (`grep ^vscan: /etc/passwd` eq "") { + print "You need a user \"${user}\".\n"; + if (yesno("Would you like me to create it", "y")) { + system ("/usr/sbin/pw useradd ${user} -g ${group} -h - -d /nonexistent -s /nonexistent -c \"AMaViS Virus Scanner\" || exit"); + print "Done.\n"; + } else { + print "Please create it, and try again.\n"; + exit 1; + }; +} else { + print "You already have a user \"${user}\", so I will use it.\n"; +}; + +sub yesno() { + my ($mes, $def) = @_; + print "$mes [$def]? "; + $answer = <STDIN>; + chomp($answer); + if ($answer eq "") { + $answer = "y"; + }; + if ($answer=~/^y/i) { + return 1; + }; + return 0; +}; diff --git a/security/amavis-perl/pkg-message.postfix b/security/amavis-perl/pkg-message.postfix new file mode 100644 index 000000000000..157785706d1b --- /dev/null +++ b/security/amavis-perl/pkg-message.postfix @@ -0,0 +1,22 @@ + +Please read documentation on http://www.amavis.org/ before you start using it. + + To configure postfix, you have to do later: + + * add + + content_filter = vscan: + + to /usr/local/etc/postfix/main.cf + + * add + + vscan unix - n n - 10 pipe user-vscan + argv=/usr/local/sbin/amavis ${sender} ${recipient} + localhost:10025 inet n - n - - smtpd + -o content_filter= + + to /etc/postfix/master.cf. + +Please read /usr/local/share/doc/amavis/README.postfix for further information + |