Summary: Sendmail milter for spamassassin Name: spamass-milter Version: 0.3.1 Release: 4 License: GPL Group: System Environment/Daemons URL: http://savannah.nongnu.org/projects/spamass-milt/ Source0: http://savannah.nongnu.org/download/spamass-milt/spamass-milter-%{version}.tar.gz Source1: spamass-milter-wrapper BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: spamassassin, sendmail-devel Requires: spamassassin, sendmail Requires(pre): /usr/sbin/useradd Requires(post): /sbin/chkconfig Requires(post): /sbin/service Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service Requires(postun): /sbin/service %description A Sendmail milter (Mail Filter) library that pipes all incoming mail (including things received by rmail/UUCP) through the SpamAssassin, a highly customizable spam filter. %prep %setup -q %{__cp} %{SOURCE1} . %{__sed} -i -e 's@local:/var/run/sendmail/spamass.sock@unix:%{_localstatedir}/run/spamass-milter/spamass-milter.sock@' README %{__cat} <spamass-milter.sysconfig ### Override for your different local config #SOCKET=%{_localstatedir}/run/spamass-milter/spamass-milter.sock ### Standard parameters for spamass-milter are: ### -P %{_localstatedir}/run/spamass-milter.pid (PID file) ### ### Note that the -f parameter for running the milter in the background ### is not required because the milter runs in a wrapper script that ### backgrounds itself ### ### You may add another parameters here, see spamass-milter(1) #EXTRA_FLAGS="-m -r 15" EOF %{__cat} <<'EOF' >spamass-milter.sysv #!/bin/bash # # Init file for Spamassassin sendmail milter. # # chkconfig: - 79 21 # description: spamass-milter is a daemon that hooks into sendmail and \ # routes email messages to spamassassin # # processname: spamass-milter # config: %{_sysconfdir}/sysconfig/spamass-milter # pidfile: %{_localstatedir}/run/spamass-milter.pid source %{_initrddir}/functions source %{_sysconfdir}/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x %{_sbindir}/spamass-milter ] || exit 1 ### Default variables SOCKET="%{_localstatedir}/run/spamass-milter/spamass-milter.sock" EXTRA_FLAGS="" SYSCONFIG="%{_sysconfdir}/sysconfig/spamass-milter" ### Read configuration [ -r "$SYSCONFIG" ] && source "$SYSCONFIG" RETVAL=0 prog="spamass-milter" desc="SpamAssassin milter" pidfile=%{_localstatedir}/run/spamass-milter.pid start() { echo -n $"Starting $desc ($prog): " touch $pidfile chown sa-milt:sa-milt $pidfile daemon --user sa-milt %{_sbindir}/${prog}-wrapper -p $SOCKET -P $pidfile $EXTRA_FLAGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch %{_localstatedir}/lock/subsys/spamass-milter return $RETVAL } stop() { echo -n $"Shutting down $desc ($prog): " rm -f %{_localstatedir}/lock/subsys/spamass-milter killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f $pidfile return $RETVAL } restart() { stop sleep 2 start } case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condrestart) [ -e %{_localstatedir}/lock/subsys/spamass-milter ] && restart RETVAL=$? ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" RETVAL=1 esac exit $RETVAL EOF %build export SENDMAIL=/usr/sbin/sendmail %configure %{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} %{__make} DESTDIR=%{buildroot} install %{__install} -D -m0755 spamass-milter.sysv %{buildroot}%{_initrddir}/spamass-milter %{__install} -D -m0644 spamass-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/spamass-milter %{__install} -d -m0700 %{buildroot}%{_localstatedir}/run/spamass-milter %{__install} -m0755 spamass-milter-wrapper %{buildroot}%{_sbindir}/spamass-milter-wrapper %pre /usr/sbin/useradd -r -s /sbin/nologin -d %{_localstatedir}/run/spamass-milter \ -c "SpamAssassin Milter" sa-milt &>/dev/null || : %post /sbin/chkconfig --add spamass-milter || : %preun if [ $1 -eq 0 ]; then /sbin/service spamass-milter stop &>/dev/null || : /sbin/chkconfig --del spamass-milter || : fi %postun /sbin/service spamass-milter condrestart &>/dev/null || : %clean %{__rm} -rf %{buildroot} %files %defattr(-, root, root, 0755) %doc AUTHORS ChangeLog NEWS README %{_mandir}/man1/spamass-milter.1* %config(noreplace) %{_sysconfdir}/sysconfig/spamass-milter %{_initrddir}/spamass-milter %{_sbindir}/spamass-milter %{_sbindir}/spamass-milter-wrapper %dir %attr(-,sa-milt,sa-milt) %{_localstatedir}/run/spamass-milter %changelog * Wed Aug 30 2006 Paul Howarth 0.3.1-4 - Use make/DESTDIR instead of deprecated %%makeinstall macro - Expand tabs and clean up changelog entries * Mon May 15 2006 Paul Howarth 0.3.1-3 - Use upstream default settings (#191602) This change re-enables by default Subject/Content-Type header modification (which may have a performance impact for large messages) and disables by default the rejection of emails with a spam score of 15 or more. To re-enable these options, uncomment the line: EXTRA_FLAGS="-m -r 15" in %%{_sysconfdir}/sysconfig/spamass-milter * Sun May 7 2006 Paul Howarth 0.3.1-2 - Fix race condition in "stop" clause of initscript (#190894) * Thu Apr 6 2006 Paul Howarth 0.3.1-1 - Update to 0.3.1 * Wed Feb 16 2006 Paul Howarth 0.3.0-9 - Don't use macros in command paths, hardcode them instead * Mon Aug 1 2005 Paul Howarth 0.3.0-8 - Run the milter in a wrapper script that restarts it if it scrashes * Thu Jun 16 2005 Paul Howarth 0.3.0-7 - Bump and rebuild due to transient build system failure * Wed Jun 15 2005 Paul Howarth 0.3.0-6 - Adjust initscript chkconfig values so it starts before sendmail * Mon Jun 13 2005 Paul Howarth 0.3.0-5 - Help the configure script find sendmail * Mon Jun 13 2005 Paul Howarth 0.3.0-4 - Bump and rebuild * Mon Jun 06 2005 Paul Howarth 0.3.0-3 - Use Extras standard buildroot - Unpack tarball quietly - Create account sa-milt and run the milter using that instead of root - Fix socket name in README - Initscript not %%config * Sun Jun 05 2005 Warren Togami 0.3.0-2 - Extras * Tue Feb 08 2005 Dag Wieers 0.3.0-1 - Updated to release 0.3.0. * Wed Sep 01 2004 Dag Wieers 0.2.0-1 - Fixed variables in sysconfig file. (mator) * Tue Feb 17 2004 Dag Wieers 0.2.0-0 - Initial package. (using DAR)