OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 30-Dec-2006 18:16:09
Branch: HEAD Handle: 2006123017160800
Added files:
openpkg-src/milter-sa fsl.milter-sa milter-sa.patch milter-sa.spec
rc.milter-sa
Log:
new package: milter-sa 0.3.1 (Mail Filter for Spam Filtering via
SpamAssassin)
Summary:
Revision Changes Path
1.1 +16 -0 openpkg-src/milter-sa/fsl.milter-sa
1.1 +76 -0 openpkg-src/milter-sa/milter-sa.patch
1.1 +142 -0 openpkg-src/milter-sa/milter-sa.spec
1.1 +65 -0 openpkg-src/milter-sa/rc.milter-sa
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/milter-sa/fsl.milter-sa
============================================================================
$ cvs diff -u -r0 -r1.1 fsl.milter-sa
--- /dev/null 2006-12-30 18:15:32 +0100
+++ fsl.milter-sa 2006-12-30 18:16:09 +0100
@@ -0,0 +1,16 @@
+##
+## fsl.milter-sa -- OSSP fsl configuration
+##
+
+ident (spamass-milter)/.+ q{
+ prefix(
+ prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+ )
+ -> {
+ debug: file(
+ path="@l_prefix@/var/milter-sa/milter-sa.log",
+ perm=0644
+ )
+ }
+};
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/milter-sa/milter-sa.patch
============================================================================
$ cvs diff -u -r0 -r1.1 milter-sa.patch
--- /dev/null 2006-12-30 18:15:32 +0100
+++ milter-sa.patch 2006-12-30 18:16:09 +0100
@@ -0,0 +1,76 @@
+Index: spamass-milter.1.in
+--- spamass-milter.1.in.orig 2004-03-18 19:37:08 +0100
++++ spamass-milter.1.in 2006-12-30 18:09:16 +0100
+@@ -199,6 +199,9 @@
+ Requires the
+ .Fl u
+ flag.
++.It Fl a
++Causes spamass-milter to pass through unchecked any messages from
connections
++established using SMTP authentication. This is useful for sites with
remote users.
+ .It Fl - Ar spamc flags ...
+ Pass all remaining options to spamc.
+ This allows you to connect to a remote spamd with
+Index: spamass-milter.cpp
+--- spamass-milter.cpp.orig 2006-03-23 22:41:36 +0100
++++ spamass-milter.cpp 2006-12-30 18:09:16 +0100
+@@ -170,6 +170,7 @@
+ bool flag_full_email = false; /* pass full email address to
spamc */
+ bool flag_expand = false; /* alias/virtusertable expansion */
+ bool warnedmacro = false; /* have we logged that we couldn't fetch a
macro? */
++bool auth = false; /* don't scan authenticated users */
+
+ #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */
+ static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER;
+@@ -181,7 +182,7 @@
+ main(int argc, char* argv[])
+ {
+ int c, err = 0;
+- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x";
++ const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xa";
+ char *sock = NULL;
+ bool dofork = false;
+ char *pidfilename = NULL;
+@@ -196,6 +197,9 @@
+ /* Process command line options */
+ while ((c = getopt(argc, argv, args)) != -1) {
+ switch (c) {
++ case 'a':
++ auth = true;
++ break;
+ case 'f':
+ dofork = true;
+ break;
+@@ -281,7 +285,7 @@
+ cout << "SpamAssassin Sendmail Milter Plugin" << endl;
+ cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d
xx[,yy...]] [-D host]" << endl;
+ cout << " [-e defaultdomain] [-f] [-i networks]
[-m] [-M]" << endl;
+- cout << " [-P pidfile] [-r nn] [-u defaultuser]
[-x]" << endl;
++ cout << " [-P pidfile] [-r nn] [-u defaultuser]
[-x] [-a]" << endl;
+ cout << " [-- spamc args ]" << endl;
+ cout << " -p socket: path to create socket" << endl;
+ cout << " -b bucket: redirect spam to this mail address. The
orignal" << endl;
+@@ -302,6 +306,7 @@
+ cout << " -u defaultuser: pass the recipient's username to spamc.\n"
+ " Uses 'defaultuser' if there are multiple
recipients." << endl;
+ cout << " -x: pass email address through alias and virtusertable
expansion." << endl;
++ cout << " -a: don't scan messages over an authenticated
connection." << endl;
+ cout << " -- spamc args: pass the remaining flags to spamc." <<
endl;
+
+ exit(EX_USAGE);
+@@ -783,6 +788,15 @@
+ }
+ /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */
+
++ if (auth) {
++ const char *auth_type = smfi_getsymval(ctx, "{auth_type}");
++
++ if (auth_type) {
++ debug(D_MISC, "auth_type=%s", auth_type);
++ return SMFIS_ACCEPT;
++ }
++ }
++
+ debug(D_FUNC, "mlfi_envfrom: enter");
+ try {
+ // launch new SpamAssassin
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/milter-sa/milter-sa.spec
============================================================================
$ cvs diff -u -r0 -r1.1 milter-sa.spec
--- /dev/null 2006-12-30 18:15:32 +0100
+++ milter-sa.spec 2006-12-30 18:16:09 +0100
@@ -0,0 +1,142 @@
+##
+## milter-sa.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package information
+Name: milter-sa
+Summary: Mail Filter for Spam Filtering via SpamAssassin
+URL: http://savannah.nongnu.org/projects/spamass-milt/
+Vendor: Georg C. F. Greve et al.
+Packager: OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class: EVAL
+Group: Mail
+License: GPL
+Version: 0.3.1
+Release: 20061230
+
+# package options
+%option with_fsl yes
+
+# list of sources
+Source0:
http://download.savannah.nongnu.org/releases/spamass-milt/spamass-milter-%{version}.tar.gz
+Source1: rc.milter-sa
+Source2: fsl.milter-sa
+Patch0: milter-sa.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20060823
+PreReq: OpenPKG, openpkg >= 20060823, spamassassin
+BuildPreReq: milter, MTA
+PreReq: milter, MTA
+%if "%{with_fsl}" == "yes"
+BuildPreReq: fsl >= 1.2.0
+PreReq: fsl >= 1.2.0
+%endif
+AutoReq: no
+AutoReqProv: no
+
+%description
+ This package contains spamass-milter(1), a mail filtering gateway
+ between the MTA and SpamAssassin, based on the MILTER API.
+
+%track
+ prog milter-sa = {
+ version = %{version}
+ url =
http://download.savannah.nongnu.org/releases/spamass-milt/
+ regex = spamass-milter-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q -n spamass-milter-%{version}
+ %patch -p0
+
+%build
+ # configure program
+ %{l_shtool} subst \
+ -e 's;libmilter/mfapi;milter/mfapi;g' \
+ configure
+ CC="%{l_cc}" \
+ CXX="%{l_cxx}" \
+ CFLAGS="%{l_cflags -O}" \
+ CXXFLAGS="%{l_cxxflags -O}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
+ LIBS="%{l_fsl_libs}" \
+ ./configure \
+ --prefix=%{l_prefix}
+
+ # build program
+ %{l_make} %{l_mflags -O}
+
+%install
+ # install program
+ rm -rf $RPM_BUILD_ROOT
+ %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+ # strip down installation
+ strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
+
+ # install run-command script
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE rc.milter-sa} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # install OSSP fsl configuration
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE fsl.milter-sa} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+
+ # create run-time directory
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/var/milter-sa
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/fsl/*' \
+ '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/milter-sa'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ # after upgrade, restart service
+ [ $1 -eq 2 ] || exit 0
+ eval `%{l_rc} milter-sa status 2>/dev/null`
+ [ ".$milter_sa_active" = .yes ] && %{l_rc} milter-sa restart
+ exit 0
+
+%preun
+ # before erase, stop service and remove log files
+ [ $1 -eq 0 ] || exit 0
+ %{l_rc} milter-sa stop 2>/dev/null
+ rm -f $RPM_INSTALL_PREFIX/var/milter-sa/* >/dev/null 2>&1 || true
+ exit 0
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/milter-sa/rc.milter-sa
============================================================================
$ cvs diff -u -r0 -r1.1 rc.milter-sa
--- /dev/null 2006-12-30 18:15:32 +0100
+++ rc.milter-sa 2006-12-30 18:16:09 +0100
@@ -0,0 +1,65 @@
[EMAIL PROTECTED]@/bin/openpkg rc
+##
+## rc.milter-sa -- Run-Commands
+##
+
+%config
+ milter_sa_enable="$openpkg_rc_def"
+ milter_sa_flags="-a"
+ milter_sa_prolog="true"
+ milter_sa_epilog="true"
+ milter_sa_numfiles="10"
+ milter_sa_minsize="1M"
+ milter_sa_complevel="9"
+
+%common
+ milter_sa_pidfile="@l_prefix@/var/milter-sa/milter-sa.pid"
+ milter_sa_logfile="@l_prefix@/var/milter-sa/milter-sa.log"
+ milter_sa_socket="@l_prefix@/var/milter-sa/milter-sa.socket"
+ milter_sa_signal () {
+ [ -f $milter_sa_pidfile ] && kill -$1 `cat $milter_sa_pidfile`
+ }
+
+%status -u @l_susr@ -o
+ milter_sa_usable="unknown"
+ milter_sa_active="no"
+ rcService milter-sa enable yes && \
+ milter_sa_signal 0 && milter_sa_active="yes"
+ echo "milter_sa_enable=\"$milter_sa_enable\""
+ echo "milter_sa_usable=\"$milter_sa_usable\""
+ echo "milter_sa_active=\"$milter_sa_active\""
+
+%start -u @l_rusr@
+ rcService milter-sa enable yes || exit 0
+ rcService milter-sa active yes && exit 0
+ rm -f $milter_sa_socket >/dev/null 2>&2 || true
+ ( umask 002
+ export [EMAIL PROTECTED]@/bin:$PATH
+ @l_prefix@/sbin/spamass-milter \
+ -f -p local:$milter_sa_socket \
+ -P $milter_sa_pidfile \
+ $milter_sa_flags
+ ) || exit $?
+
+%stop -u @l_rusr@
+ rcService milter-sa enable yes || exit 0
+ rcService milter-sa active no && exit 0
+ milter_sa_signal TERM
+ sleep 2
+ rm -f $milter_sa_pidfile >/dev/null 2>&1 || true
+ rm -f $milter_sa_socket >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+ rcService milter-sa enable yes || exit 0
+ rcService milter-sa active no && exit 0
+ rc milter-sa stop start
+
+%daily -u @l_susr@
+ rcService milter-sa enable yes || exit 0
+ shtool rotate -f \
+ -n $milter_sa_numfiles -s $milter_sa_minsize -d \
+ -z $milter_sa_complevel -m 644 -o @l_rusr@ -g @l_rgrp@ \
+ -P "$milter_sa_prolog" \
+ -E "$milter_sa_epilog; rc milter-sa restart" \
+ $milter_sa_logfile
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]