# NOTE THAT THIS PACKAGE BUILDS AGAINST LIBSPF2 VERSION 1.0.X # THIS LIBRARY HAS KNOWN CASE-SENSITIVITY BUGS AND WILL CAUSE # THE MILTER TO REJECT SOME VALID MAIL FOR DOMAINS THAT USE # "ptr" MECHANISMS %define milterver 0.97 %define rpmrel 3 # Put `mdk' at end of release name for builds on Mandrake %define is_mandrake %(if %{__grep} '^Mandrake *[Ll]inux' /etc/redhat-release >/dev/null 2>&1; then echo 1; else echo 0; fi) %if %{is_mandrake} %define rpmrelease %{rpmrel}mdk %define __id_u /bin/id -u %else %define rpmrelease %{rpmrel} %endif # Where to put the initscript %{!?_initrddir: %define _initrddir /etc/rc.d/init.d} Summary: SPF mail filter module Name: spfmilter Epoch: 1 Version: %{milterver} Release: %{rpmrelease} License: ACME Labs Freeware License Group: System Environment/Daemons Url: http://www.acme.com/software/spfmilter/ Source0: http://www.acme.com/software/spfmilter/spfmilter-%{version}.tar.gz Source1: RPM-HOWTO Requires: sendmail >= 8.12 BuildRequires: sendmail-devel >= 8.12, libspf2-devel >= 1.0.4-3, libspf2-devel < 1.2, sed BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): chkconfig >= 1.3, shadow-utils Requires(post): chkconfig >= 1.3 Requires(preun): chkconfig >= 1.3, /sbin/service Requires(postun): /sbin/service %description Spfmilter implements the Sender Policy Framework (http://spf.pobox.com/) as a milter, using the libspf2 library. The idea of SPF is to prevent email forgery. Each participating domain sets up a little definition of which hosts are allowed to send mail claiming to be from that domain. When another site receives mail, it checks the permitted-senders definition for the originating domain. If the check fails, the mail is rejected. %prep %setup -q %{__cp} -p %{SOURCE1} . echo '# See spfmilter(8) for details of the format of this file' > spfmilter-whitelist echo '# See spfmilter(8) for details of the format of this file' > spfmilter-fallback %build # Force non-detection of libspf export as_ac_Header_libspf_spf_h=no export ac_cv_search_SPF_init=no %configure %{__sed} -i -e 's/-o bin -g bin //' -e 's/-m 444/-m 644/' -e 's/-m 555/-m 755/' Makefile %{__make} %{?_smp_mflags} %install [ "$RPM_BUILD_ROOT" != "/" -a -n "$RPM_BUILD_ROOT" ] && %{__rm} -rf $RPM_BUILD_ROOT %{__make} BINDIR=$RPM_BUILD_ROOT%{_sbindir} MANDIR=$RPM_BUILD_ROOT%{_mandir} install %{__mkdir} -p $RPM_BUILD_ROOT{%{_sysconfdir}/{sysconfig,mail},%{_initrddir}} %{__install} -m 755 rc_scripts/redhat $RPM_BUILD_ROOT%{_initrddir}/spfmilter %{__install} -m 644 rc_scripts/redhat_sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/spfmilter %{__install} -m 644 spfmilter-whitelist $RPM_BUILD_ROOT%{_sysconfdir}/mail/ %{__install} -m 644 spfmilter-fallback $RPM_BUILD_ROOT%{_sysconfdir}/mail/ %{__install} -d -m 700 $RPM_BUILD_ROOT%{_localstatedir}/run/spfmilter : > $RPM_BUILD_ROOT%{_localstatedir}/run/spfmilter/spfmilter.sock : > $RPM_BUILD_ROOT%{_localstatedir}/run/spfmilter.pid %clean [ "$RPM_BUILD_ROOT" != "/" -a -n "$RPM_BUILD_ROOT" ] && %{__rm} -rf $RPM_BUILD_ROOT %pre # Create user spfmilt to run the milter /usr/sbin/useradd -r -d /etc/mail -s /sbin/nologin \ -c "SPF Milter" spfmilt &> /dev/null || : exit 0 %post /sbin/chkconfig --add spfmilter || : exit 0 %preun if [ $1 -eq 0 ]; then /sbin/service spfmilter stop &> /dev/null || : /sbin/chkconfig --del spfmilter || : fi exit 0 %postun [ $1 -gt 0 ] && /sbin/service spfmilter condrestart &> /dev/null || : exit 0 %files %defattr(-,root,root,0755) %doc README RPM-HOWTO %{_sbindir}/spfmilter %{_mandir}/man8/spfmilter.8* %{_initrddir}/spfmilter %dir %attr(-,spfmilt,spfmilt) %{_localstatedir}/run/spfmilter %config (noreplace) %{_sysconfdir}/sysconfig/spfmilter %config (noreplace) %{_sysconfdir}/mail/spfmilter-whitelist %config (noreplace) %{_sysconfdir}/mail/spfmilter-fallback %ghost %{_localstatedir}/run/spfmilter/spfmilter.sock %ghost %{_localstatedir}/run/spfmilter.pid %changelog * Sun Mar 26 2006 Petr Kriątof 1:0.97-3 - Rebuild on FC-5 * Thu Aug 25 2005 Petr Kriątof 1:0.97-2 - Remove wrapper * Thu Aug 4 2005 Paul Howarth 1:0.97-1 - new upstream version 0.97 - remove initscript patch, now included upstream - use tidier bash syntax in scriptlets - fix permissions of installed files - add comment about file format to fallback and whitelist files - ghost the socket and pidfile rather than removing %{_localstatedir}/run/spfmilter in %%post - don't remove user/group at uninstall - run the milter in a wrapper script that restarts it if it crashes - force non-detection of libspf to ensure build against libspf2 - fix Makefile to prevent attempted chowns in %%install * Wed Apr 27 2005 Paul Howarth 1:0.96-1 - new upstream version 0.96 - add warning in spec file that libspf2 1.0.x is buggy * Thu Feb 24 2005 Paul Howarth 1:0.95-3 - remove Requires: libspf2; automatic library dependencies will suffice - improve detection of Mandrake build system * Mon Jan 17 2005 Paul Howarth 1:0.95-2 - incorporate suggestions from Petr Krištof (petr at kristov dot cz) replace _var with _localstatedir macro replace /etc with _sysconfdir macro stop spfmilter service before removal of package remove %{_localstatedir}/run/spfmilter and contents after removal of package restart milter after package upgrade - use sed instead of perl during package build * Mon Sep 27 2004 Paul Howarth 1:0.95-1 - update to 0.95 * Wed Sep 15 2004 Paul Howarth 1:0.94-3 - tidy up initscript (pidfile in /var/run) * Mon Sep 13 2004 Paul Howarth 1:0.94-2 - remove linkage to libspf if present at build time, which generates bogus dependencies - build-time dependency for perl added to allow the above fix * Mon Sep 13 2004 Paul Howarth 1:0.94-1 - now building from Jef's package rather than Shevek's; version number adjusted accordingly and epoch bumped to 1 - initscript now incorporated upstream so not included as a separate item in SRPM - tweak install directories as Jef's package is a little less packager-friendly (no DESTDIR support) * Tue Aug 10 2004 Paul Howarth 1.0.8-1 - update to Shevek's 1.0.8 version (Jef's 0.93) * Sun Aug 8 2004 Paul Howarth 1.0.7-5 - added patch to bump spfmilter to Jef's version 0.93 - require libspf2 >= 1.0.4-6 to avoid case sensitivity bug * Fri Aug 6 2004 Paul Howarth 1.0.7-4 - remove large buffers patch, not thread safe * Fri Aug 6 2004 Paul Howarth 1.0.7-3 - added patch to bump spfmilter to Jef's version 0.92 - added patch to stop allocating large buffers on stack - remove patches added in 1.0.7-2, now incorporated upstream * Thu Jul 29 2004 Paul Howarth 1.0.7-2 - initscript fixed so that `service spfmilter stop|restart' will recover from crash - added patch to bump spfmilter to Jef's version 0.90 - added patch to use only the sender's domain name rather than full address for fallback pattern matching - added patch to remove only Received-SPF: headers that appear to have originated at our host * Thu Jul 29 2004 Paul Howarth 1.0.7-1 - update to 1.0.7 - remove trusted-forwarders patch, now incorporated upstream - autoconf and automake no longer needed for build * Wed Jul 28 2004 Paul Howarth 1.0.6-4 - remove -pthread, which doesn't help - add patch to fix --recipientmx * Tue Jul 27 2004 Paul Howarth 1.0.6-3 - build with -pthread to see if it un-breaks --recipientmx. * Thu Jul 15 2004 Paul Howarth 1.0.6-2 - revert configure.ac patch, no longer needed now that libspf2-devel includes the libtool library. - remove references to %{_sysconfdir}, not portable enough. * Wed Jul 14 2004 Paul Howarth 1.0.6-1 - update to 1.0.6 - fix configure.ac to detect need for -lresolv * Tue Jul 13 2004 Paul Howarth 1.0.5-1 - update to 1.0.5 - all patches removed due to having been incorporated upstream - RPM-HOWTO updated to remove defunct section on logging and add items on whitelist and fallback records - add patch to fix reference to trusted-forwarder.org that is incorrectly pointing to non-existent domain trusted-forwarder.com - move mandir override from %%install to %%build - change PreReq for /usr/sbin/useradd to shadow-utils - add empty default fallback and whitelist files in /etc/mail * Wed Jul 07 2004 Paul Howarth 1.0.4-2 - added option to write PID file - used PID file option in initscript * Mon Jul 05 2004 Paul Howarth 1.0.4-1 - first RPM version