Subject: threads, milter, amavis: newbie questions
To: None <netbsd-users@netbsd.org>
From: Lista de NetBSD Users <list10@sepc.edu.mx>
List: netbsd-users
Date: 06/04/2002 10:45:16
Hello

I am using NetBSD-1.5.2/i386 and I want to use
amavis-milter for check virus in our mail gateway
(this machine just relay mail).

1 ---------------------------
In order to compile amavis-milter, I need pthreads
in my NetBSD:

checking for sendmail... /usr/sbin/sendmail
checking for qmail-inject... no
checking for inet_aton... yes
checking host system type... i386--netbsdelf
checking for pthread.h... no
configure: warning: No usable pthreads library found - disabling milter

I have seen in pkgsrc/devel 3 pthread options:

drwxrwxr-x  4 root  wheel    512 Dec  1  2001 mit-pthreads
drwxrwxr-x  4 root  wheel    512 May 30 21:42 pth
drwxrwxr-x  4 root  wheel    512 Dec  1  2001 unproven-pthreads

Question: Which is the best for me?
2 ----------------------------
I have the following two sources directory:

/usr/src/gnu/usr.sbin/sendmail
/usr/src/gnu/dist/sendmail

I need compile my sendmail with support for milter
and install libmilter

Question:
How can I do this?
In which directory?
--------------------------------

Thanks in advance

Heron Gallegos
Centro Siglo XXI - Informatica Educativa
Saltillo, Coahuila, Mexico
-------------------------------
More info (just informational)

I copied pkgsrc/amavis-perl to pkgsrc/amavis-milter
I changed some lines in amavis-milter/Makefile
(these lines was for use with postfix... I use sendmail)
(also these was for an environment of machine with mail
accounts and my box is a relay)

venera# diff -u amavis-perl/Makefile amavis-milter/Makefile
--- amavis-perl/Makefile        Fri Nov  2 10:57:04 2001
+++ amavis-milter/Makefile      Mon Jun  3 21:54:25 2002
@@ -2,7 +2,7 @@
 #

 DISTNAME=      amavisd-snapshot-${VERSION}
-PKGNAME=       amavis-perl-${VERSION}
+PKGNAME=       amavis-milter-${VERSION}
 CATEGORIES=    security mail
 MASTER_SITES=  http://www.amavis.org/dist/perl/ \
                ${MASTER_SITE_SOURCEFORGE:=amavis/}
@@ -14,7 +14,6 @@
 CONFLICTS+=    amavis-[0-9]*

 DEPENDS+=      uvscan-[0-9]*:../../security/uvscan
-DEPENDS+=      maildrop-[0-9]*:../../mail/maildrop
 DEPENDS+=      tnef-[0-9]*:../../mail/tnef
 DEPENDS+=      unzip-[0-9]*:../../archivers/unzip
 DEPENDS+=      unarj-[0-9]*:../../archivers/unarj
@@ -35,23 +34,20 @@

 VERSION=       20010714

-SMTPPORT?=     10025                   # target port for scanned mails
 VIRUSDIR?=     /var/log/virusmails     # where to put contaminated mails
 VIRUSMAILTO?=  security                # whom to notify about viruses

 GNU_CONFIGURE= YES

-CONFIGURE_ENV+=        procmail="/usr/libexec/mail.local"
-
 CONFIGURE_ARGS+=--sysconfdir=${PREFIX}/etc/amavis
 CONFIGURE_ARGS+=--with-virusdir=${VIRUSDIR}
 CONFIGURE_ARGS+=--with-mailto=${VIRUSMAILTO}
-CONFIGURE_ARGS+=--enable-all
-CONFIGURE_ARGS+=--enable-smtp --with-smtp-port=${SMTPPORT}
+CONFIGURE_ARGS+=--enable-milter
+CONFIGURE_ARGS+=--enable-relay

 do-install:
        # Program files
-       ${INSTALL_PROGRAM} ${WRKSRC}/amavis/amavis ${PREFIX}/sbin
+       ${INSTALL_PROGRAM} ${WRKSRC}/amavis/amavis-milter ${PREFIX}/sbin
        ${INSTALL_SCRIPT} ${WRKSRC}/amavis/amavisd ${PREFIX}/sbin
        # Documents
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/amavis
venera#
----------------------------------------------
venera# diff -u amavis-perl/PLIST amavis-milter/PLIST
--- amavis-perl/PLIST   Wed Oct 31 19:16:30 2001
+++ amavis-milter/PLIST Tue Jun  4 09:49:40 2002
@@ -1,5 +1,5 @@
 @comment $NetBSD: PLIST,v 1.1 2001/11/01 01:16:30 zuntum Exp $
-sbin/amavis
+sbin/amavis-milter
 sbin/amavisd
 share/doc/amavis/FAQ
 share/doc/amavis/LICENSE.sendmail
venera#
-----------------------
And... when the problem of pthreads ans libmilter have
the solution, then

+CONFIGURE_ARGS+=--with-sendmail-source=/usr/src/gnu/dist/sendmail/include
+CONFIGURE_ARGS+=--with-origconf=/etc/mail/sendmail.cf
+CONFIGURE_ARGS+=--enable-syslog
+CONFIGURE_ARGS+=--with-syslog-level=LOCAL4.info

And... if it works...

write an m4 script for add automatic the following:

define(`_FFR_MILTER', `1')dnl
INPUT_MAIL_FILTER(`milter-amavis', `S=local:/var/amavis/amavis-milter.sock, T=S:10m;R:10m;E:10m')dnl

and write an rc,d script with the following
(with some like this)

rm -rf /var/amavis/amavis-milter.sock
nohup /usr/pkg/sbin/amavis-milter -p /var/amavis/amavis-milter.sock &
/usr/pkg/sbin/amavisd