Bug 32471 - amavis-perl only usable for sendmail
Summary: amavis-perl only usable for sendmail
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-03 14:50 UTC by Martijn Lina
Modified: 2002-06-17 20:28 UTC (History)
0 users

See Also:


Attachments
file.diff (434 bytes, patch)
2001-12-03 14:50 UTC, Martijn Lina
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martijn Lina 2001-12-03 14:50:01 UTC
	There's no way to define for which MTA amavis-perl should be built.
	Therefor, when using an MTA other than sendmail, the supporting code
	in amavis is not included in the installed script.

How-To-Repeat: 	cd /usr/ports/security/amavis-perl && make && make install
	# Now try and set up an amavis content_filter as described in
	# /usr/local/share/doc/amavis/README.postfix
Comment 1 Mas.TAKEMURA 2001-12-15 05:39:50 UTC
I update postfix support.

following patch is diff to 
$FreeBSD: ports/security/amavis-perl/Makefile,v 1.5 2001/10/21 18:47:20 dwcjr Exp $
--
TAKEMURA Masahiro : mastake@msel.t.u-tokyo.ac.jp


diff -urP amavis-perl.orig/Makefile amavis-perl/Makefile
--- amavis-perl.orig/Makefile	Mon Oct 22 03:47:20 2001
+++ amavis-perl/Makefile	Sat Dec 15 13:29:55 2001
@@ -50,7 +50,18 @@
 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 @@
 
 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 @@
 .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 -urP amavis-perl.orig/pkg-install.postfix amavis-perl/pkg-install.postfix
--- amavis-perl.orig/pkg-install.postfix	Thu Jan  1 09:00:00 1970
+++ amavis-perl/pkg-install.postfix	Sat Dec 15 12:48:39 2001
@@ -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 -urP amavis-perl.orig/pkg-message.postfix amavis-perl/pkg-message.postfix
--- amavis-perl.orig/pkg-message.postfix	Thu Jan  1 09:00:00 1970
+++ amavis-perl/pkg-message.postfix	Sat Dec 15 12:50:20 2001
@@ -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
+
Comment 2 teramoto 2002-03-25 10:03:44 UTC
Hi.

This patch works my FreeBSD box, with postfix-1.1.5, Sophos
sweep 3.55.

# make MTA=postfix install

Thank you.

-- 
TERAMOTO Masahiro
   teramoto@comm.eng.osaka-u.ac.jp
Comment 3 jdunn 2002-05-02 04:37:23 UTC
TAKEMURA Masahiro's patch works for me, too, using postfix-20020115 with
McAfee's AV scanner (uvscan-4.16e_1)

- Julian
 
-- 
[     Julian C. Dunn <jdunn@aquezada.com> * <julian@dreaming.org>      ]
[    WWW: http://www.aquezada.com/staff/julian/  * PGP: 0xFDC205B9     ]
[                   "you can't see the future when                     ]
[          it's all disguised as the past" - nerissa nields            ]
Comment 4 Ying-Chieh Liao freebsd_committer freebsd_triage 2002-06-17 20:28:30 UTC
State Changed
From-To: open->closed

committed, thanks