summaryrefslogtreecommitdiff
path: root/security/amavis-perl
diff options
context:
space:
mode:
authorYing-Chieh Liao <ijliao@FreeBSD.org>2002-06-17 19:28:21 +0000
committerYing-Chieh Liao <ijliao@FreeBSD.org>2002-06-17 19:28:21 +0000
commit3fe92c064405eaf92ebe67ab8b99638b37976ab0 (patch)
treece42580cf21cdc4ff44e64d54a4bce40fb092876 /security/amavis-perl
parentUnbreak this port by using the included libneon and expat. The API for (diff)
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)
Notes
Notes: svn path=/head/; revision=61434
Diffstat (limited to 'security/amavis-perl')
-rw-r--r--security/amavis-perl/Makefile18
-rw-r--r--security/amavis-perl/pkg-install.postfix31
-rw-r--r--security/amavis-perl/pkg-message.postfix22
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
+