A new user interface for you! Read more...

File spamass-milter.spec of Package spamass-milter

Summary:	Milter (mail filter) for spamassassin
Name:		spamass-milter
Version:	0.3.2
Release:	2%{?dist}
License:	GPLv2+
Group:		System Environment/Daemons
URL:		http://savannah.nongnu.org/projects/spamass-milt/
Source0:	http://savannah.nongnu.org/download/spamass-milt/spamass-milter-%{version}.tar.bz2
Source2:	spamass-milter.sysv
Source3:	spamass-milter.sysconfig
Source4:	spamass-milter.README.Postfix
Source5:	spamass-milter-tmpfs.conf
Source6:	spamass-milter-postfix-tmpfs.conf
# Patches submitted upstream:
# http://savannah.nongnu.org/bugs/?29326
Patch0:		spamass-milter-0.3.2-syntax.patch
Patch2:		spamass-milter-0.3.1-authuser.patch
Patch3:		spamass-milter-0.3.2-rcvd.patch
Patch4:		spamass-milter-0.3.2-bits.patch
Patch5:		spamass-milter-0.3.1-group.patch
# Patch not yet submitted upstream
Patch7:		spamass-milter-0.3.1-ipv6.patch
# Fedora-specific patches
Patch10:	spamass-milter-0.3.1-pathnames.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildRequires:	gcc-c++
BuildRequires:	spamassassin, sendmail-devel
Requires:	spamassassin, /usr/sbin/sendmail
%if 0%{?fedora} > 14
Requires:	systemd-units
%endif

Requires(pre): /usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd, /usr/sbin/usermod
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig, initscripts
Requires(postun): initscripts

%description
A milter (Mail Filter) application that pipes incoming mail (including things
received by rmail/UUCP) through SpamAssassin, a highly customizable spam
filter. A milter-compatible MTA such as Sendmail or Postfix is required.

%package postfix
Summary:	Postfix support for spamass-milter
Group:		System Environment/Daemons
Requires:	%{name} = %{version}-%{release}
Requires(pre):	postfix
Requires(post):	shadow-utils, %{name} = %{version}-%{release}
%if 0%{?fedora} > 9 || 0%{?rhel} > 5
BuildArch:	noarch
%endif

%description postfix
This package adds support for running spamass-milter using a Unix-domain
socket to communicate with the Postfix MTA.

%prep
%setup -q

# Address compiler warnings
%patch0 -p1 -b .syntax

# Add -I option to ignore (don't check) mail from authenticated users
# (#437506, #496767) http://savannah.nongnu.org/bugs/?21046
%patch2 -p1 -b .authuser

# Fix Received-header generation (#496763)
%patch3 -p1 -b .rcvd

# Add authentication info to dummy Received-header (#496769)
%patch4 -p1 -b .bits

# Add -g option for group-writable socket for Postfix support (#452248)
%patch5 -p1 -b .group

# Add IPv6 whitelisting support
%patch7 -p1 -b .ipv6

# Local patch for initscript and socket paths
%patch10 -p1 -b .pathnames

cp -p %{SOURCE2} %{SOURCE3} %{SOURCE4} .
sed -i -e	's|%%{_localstatedir}|%{_localstatedir}|g;
		 s|%%{_initrddir}|%{_initrddir}|g;
		 s|%%{_sysconfdir}|%{_sysconfdir}|g;
		 s|%%{_sbindir}|%{_sbindir}|g;' \
	spamass-milter.{README.Postfix,sysv,sysconfig} README
mv spamass-milter.README.Postfix README.Postfix

%build
export SENDMAIL=/usr/sbin/sendmail
%configure
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

install -m 755 -D spamass-milter.sysv %{buildroot}%{_initrddir}/spamass-milter
install -m 644 -D spamass-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/spamass-milter
install -m 755 -d %{buildroot}%{_localstatedir}/lib/spamass-milter
install -m 711 -d %{buildroot}%{_localstatedir}/run/spamass-milter
install -m 750 -d %{buildroot}%{_localstatedir}/run/spamass-milter/postfix

# Make sure /var/run/spamass-milter{,/postfix} exist at boot time for systems
# with /var/run on tmpfs (#656692)
%if 0%{?fedora} > 14
install -d -m 755 %{buildroot}%{_sysconfdir}/tmpfiles.d
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/tmpfiles.d/spamass-milter.conf
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/tmpfiles.d/spamass-milter-postfix.conf
%endif

%clean
rm -rf %{buildroot}

%pre
/usr/bin/getent group sa-milt >/dev/null || /usr/sbin/groupadd -r sa-milt
/usr/bin/getent passwd sa-milt >/dev/null || \
	/usr/sbin/useradd -r -g sa-milt -d %{_localstatedir}/lib/spamass-milter \
		-s /sbin/nologin -c "SpamAssassin Milter" sa-milt
# Fix homedir for upgrades
/usr/sbin/usermod --home %{_localstatedir}/lib/spamass-milter sa-milt &>/dev/null
exit 0

%post
/sbin/chkconfig --add spamass-milter || :

%preun
if [ $1 -eq 0 ]; then
	%{_initrddir}/spamass-milter stop &>/dev/null || :
	/sbin/chkconfig --del spamass-milter || :
fi

%postun
%{_initrddir}/spamass-milter condrestart &>/dev/null || :

%post postfix
# This is needed because the milter needs to "give away" the MTA communication
# socket to the postfix group, and it needs to be a member of the group to do
# that.
/usr/sbin/usermod -a -G postfix sa-milt || :

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog NEWS README
%{_mandir}/man1/spamass-milter.1*
%config(noreplace) %{_sysconfdir}/sysconfig/spamass-milter
%if 0%{?fedora} > 14
%{_sysconfdir}/tmpfiles.d/spamass-milter.conf
%endif
%{_initrddir}/spamass-milter
%{_sbindir}/spamass-milter
%dir %attr(-,sa-milt,sa-milt) %{_localstatedir}/lib/spamass-milter/
%dir %attr(-,sa-milt,sa-milt) %{_localstatedir}/run/spamass-milter/

%files postfix
%defattr(-,root,root,-)
%doc README.Postfix
%if 0%{?fedora} > 14
%{_sysconfdir}/tmpfiles.d/spamass-milter-postfix.conf
%endif
%dir %attr(-,sa-milt,postfix) %{_localstatedir}/run/spamass-milter/postfix/

%changelog
* Mon Jul 18 2011 Paul Howarth <paul@city-fan.org> 0.3.2-2
- Drop the wrapper, which hasn't been needed since 0.3.1 was released
- Nobody else likes macros for commands

* Tue Feb 15 2011 Paul Howarth <paul@city-fan.org> 0.3.2-1
- Update to 0.3.2 (upstream fix for popen unsanitized input vulnerability:
  CVE-2010-1132, #572117, #572119, http://savannah.nongnu.org/bugs/?29136)
- Drop popen patch, now upstream
- Rework syntax, rcvd and bits patches to apply against new codebase

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Nov 30 2010 Paul Howarth <paul@city-fan.org> 0.3.1-24
- Require systemd-units for ownership of /etc/tmpfiles.d directory
- Add Default-Stop LSB keyword in initscript

* Fri Nov 26 2010 Paul Howarth <paul@city-fan.org> 0.3.1-23
- Make sure /var/run/spamass-milter and /var/run/spamass-milter/postfix exist
  at boot time for systems with /var/run on tmpfs (#656692)

* Wed Sep 29 2010 jkeating - 0.3.1-22
- Rebuilt for gcc bug 634757

* Thu Sep 23 2010 Paul Howarth <paul@city-fan.org> 0.3.1-21
- Add IPv6 whitelisting support (#630263)

* Tue Jun  8 2010 Paul Howarth <paul@city-fan.org> 0.3.1-20
- RHEL-6 onwards have noarch subpackages, so make spamass-milter-postfix one

* Mon Apr 19 2010 Paul Howarth <paul@city-fan.org> 0.3.1-19
- Fix patch for CVE-2010-1132 to not create a zombie process per email when
  the -x or -b options are used (#583523)

* Tue Mar 23 2010 Paul Howarth <paul@city-fan.org> 0.3.1-18
- Add patch to get rid of compiler warnings
- Reorder and re-base patches to optimize chances of upstream accepting them
- Improve Received-header patch (#496763) incorporating additional fix from
  upstream update (http://savannah.nongnu.org/bugs/?17178)

* Fri Mar 12 2010 Paul Howarth <paul@city-fan.org> 0.3.1-17
- Update initscript to support running the milter as root, which is needed
  for the -x (expand aliases) option; note that the milter does not run as
  root by default
- Add patch for popen unsanitized input vulnerability
  (CVE-2010-1132, #572117, #572119, http://savannah.nongnu.org/bugs/?29136)
- Rebase authuser patch
- Update patch adding auth info to dummy Received-header so that it doesn't
  generate spurious warnings about missing macros (#532266), and update and
  merge the macro documentation patch into this patch
- Document patch usage in spec file

* Tue Aug 11 2009 Paul Howarth <paul@city-fan.org> 0.3.1-16
- Switch to bzipped source tarball

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 0.3.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Apr 24 2009 Paul Howarth <paul@city-fan.org> 0.3.1-14
- Fix Received-header generation (#496763)
- Add authentication info to dummy Received-header (#496769)
- Add option to skip checks for authenticated senders (#437506, #496767)
  (thanks to Habeeb J. Dihu for the reports and patches)

* Wed Mar 18 2009 Paul Howarth <paul@city-fan.org> 0.3.1-13
- Call initscripts directly instead of via /sbin/service and fine-tune scriptlet
  dependencies
- Change sa-milt user's home directory from
  %%{_localstatedir}/run/spamass-milter to %%{_localstatedir}/lib/spamass-milter
  so as to retain directory contents across a reboot (#489995), and fix the home
  directory of any existing sa-milt account on upgrades

* Fri Feb 27 2009 Paul Howarth <paul@city-fan.org> 0.3.1-12
- Subpackage for postfix is now noarch for Fedora 10 onwards
- Fix scriptlet deps to ensure that sa-milt user exists before we attempt to
  add it to the postfix group

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 0.3.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Feb 13 2009 Paul Howarth <paul@city-fan.org> 0.3.1-10
- Rebuild for shared libmilter in Fedora 11 development

* Thu Jul  3 2008 Paul Howarth <paul@city-fan.org> 0.3.1-9
- Require /usr/sbin/sendmail (for -b/-B/-x options) rather than sendmail pkg
- Make summary and description less Sendmail-specific
- Add patch to support group-writable socket for MTA communication, needed
  to be able to use a Unix-domain socket with Postfix (#452248)
- Add subpackage with group-writable directory for Postfix support
- Tweak initscript to change default options when Postfix socket directory is
  present
- Document additional ENVRCPT macros to provide

* Tue May 20 2008 Paul Howarth <paul@city-fan.org> 0.3.1-8
- Fix initscript failure to start with SELinux in enforcing mode (#447247)
  (needs selinux-policy >= 3.3.1-55 on F9)

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> 0.3.1-7
- Autorebuild for GCC 4.3

* Mon Feb 18 2008 Paul Howarth <paul@city-fan.org> 0.3.1-6
- Rebuild with gcc 4.3.0 for Fedora 9

* Fri Oct 12 2007 Paul Howarth <paul@city-fan.org> 0.3.1-5
- Split initscript and config out from being here documents in the spec and
  have them as separate source files instead
- Unexpand tabs
- Clarify license as GPL v2 or later (GPLv2+)
- Use the standard scriptlet for user/group creation in %%pre

* Wed Aug 30 2006 Paul Howarth <paul@city-fan.org> 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 <paul@city-fan.org> 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 <paul@city-fan.org> 0.3.1-2
- Fix race condition in "stop" clause of initscript (#190894)

* Thu Apr  6 2006 Paul Howarth <paul@city-fan.org> 0.3.1-1
- Update to 0.3.1

* Wed Feb 16 2006 Paul Howarth <paul@city-fan.org> 0.3.0-9
- Don't use macros in command paths, hardcode them instead

* Mon Aug  1 2005 Paul Howarth <paul@city-fan.org> 0.3.0-8
- Run the milter in a wrapper script that restarts it if it crashes

* Thu Jun 16 2005 Paul Howarth <paul@city-fan.org> 0.3.0-7
- Bump and rebuild due to transient build system failure

* Wed Jun 15 2005 Paul Howarth <paul@city-fan.org> 0.3.0-6
- Adjust initscript chkconfig values so it starts before sendmail

* Mon Jun 13 2005 Paul Howarth <paul@city-fan.org> 0.3.0-5
- Help the configure script find sendmail

* Mon Jun 13 2005 Paul Howarth <paul@city-fan.org> 0.3.0-4
- Bump and rebuild

* Mon Jun 06 2005 Paul Howarth <paul@city-fan.org> 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 <wtogami@redhat.com> 0.3.0-2
- Extras

* Tue Feb 08 2005 Dag Wieers <dag@wieers.com> 0.3.0-1
- Updated to release 0.3.0.

* Wed Sep 01 2004 Dag Wieers <dag@wieers.com> 0.2.0-1
- Fixed variables in sysconfig file. (mator)

* Tue Feb 17 2004 Dag Wieers <dag@wieers.com> 0.2.0-0
- Initial package. (using DAR)