Summary: Mail filter for Sender Policy Framework verification Name: smf-spf Version: 2.4.3 Release: 1%{?dist} License: GPLv2+ Source0: https://github.com/jcbf/smf-spf/archive/v%{version}/%{name}-%{version}.tar.gz Source1: smf-spf.service Source2: smfs.conf Source3: README.rpm # Use the distribution optimization flags and don't strip the binary, # so we get usable debuginfo Patch0: smf-spf-2.4.3-Makefile.patch # Tag failing messages by default rather than rejecting them Patch2: smf-spf-2.4.3-conf.patch # Use /run rather than /var/run with systemd Patch5: smf-spf-2.4.3-rundir.patch BuildRequires: libspf2-devel >= 1.2.5 BuildRequires: sendmail-milter-devel >= 8.12 BuildRequires: systemd-units BuildRequires: gcc Requires: sendmail >= 8.12 Requires(pre): /usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd, /usr/sbin/usermod Requires(pre): shadow-utils Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %description smf-spf is a lightweight, fast and reliable Sendmail milter that implements the Sender Policy Framework technology with the help of the libspf2 library. It checks SPF records to make sure that e-mail messages are authorized by the domain that it is coming from. It's an alternative for the spfmilter, spf-milter, and milter-spiff milters. %prep %setup -q # Don't use bundled libspf2 headers, use the system ones rm -rf spf2 # Copy in additional sources cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} . %patch0 -p1 %patch2 -p1 %patch5 -p1 %build %set_build_flags OPTFLAGS="%{optflags}" %make_build %install install -d -m 700 %{buildroot}/run/smfs install -Dp -m 755 smf-spf %{buildroot}%{_sbindir}/smf-spf install -Dp -m 644 smf-spf.conf %{buildroot}%{_sysconfdir}/mail/smfs/smf-spf.conf # Install systemd unit file and tmpfiles.d configuration for /run/smfs install -Dp -m 644 smf-spf.service %{buildroot}%{_unitdir}/smf-spf.service install -Dp -m 644 smfs.conf %{buildroot}%{_prefix}/lib/tmpfiles.d/smfs.conf # Create dummy socket for %%ghost-ing : > %{buildroot}/run/smfs/smf-spf.sock %clean %pre /usr/bin/getent group smfs >/dev/null || /usr/sbin/groupadd -r smfs /usr/bin/getent passwd smfs >/dev/null || \ /usr/sbin/useradd -r -g smfs -d %{_localstatedir}/lib/smfs \ -s /sbin/nologin -c "Smart Sendmail Filters" smfs exit 0 %post %systemd_post smf-spf.service %preun %systemd_preun smf-spf.service %postun %systemd_postun_with_restart smf-spf.service %files %doc ChangeLog readme README.rpm %license COPYING %{_sbindir}/smf-spf %dir %{_sysconfdir}/mail/smfs/ %config(noreplace) %{_sysconfdir}/mail/smfs/smf-spf.conf %attr(0700,smfs,smfs) %dir /run/smfs/ %ghost /run/smfs/smf-spf.sock %{_prefix}/lib/tmpfiles.d/smfs.conf %{_unitdir}/smf-spf.service %changelog * Thu Oct 1 2020 Jordi Sanfeliu 2.4.3-1 - Updated to 2.4.3. * Sun Jul 28 2013 Paul Howarth 2.0.2-6 - Systemd detection was broken in F-19 so hardcode it instead * Tue Jul 3 2012 Paul Howarth 2.0.2-5 - Move tmpfiles.d config from %%{_sysconfdir} to %%{_prefix}/lib - Delay start-up until after network * Thu Sep 29 2011 Paul Howarth 2.0.2-4 - Use presence of /run/lock to determine if init is systemd * Wed Jul 13 2011 Paul Howarth 2.0.2-3 - Switch to systemd configuration where appropriate - Nobody else likes macros for commands * Wed Jul 28 2010 Paul Howarth 2.0.2-2 - Modernize initscript and scriptlets - Add dist tag * Thu Jan 11 2007 Paul Howarth 2.0.2-1 - Update to 2.0.2 - Failing mails now tagged [SPF:fail] by default instead of [SPF-FAIL] * Fri Sep 22 2006 Paul Howarth 2.0.1-1 - Update to 2.0.1 * Thu Sep 21 2006 Paul Howarth 2.0.0-1 - Initial RPM build