Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
120 lines (104 sloc) 4.5 KB
%define name tumgreyspf
%define version 1.00
%define release 1
%define prefix %{_prefix}
Summary: Powerful, easy to use spam protection.
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Group: Applications/System
Source: %{name}-%{version}.tar.gz
Packager: Sean Reifschneider <>
BuildRoot: /var/tmp/%{name}-root
Requires: python
Requires: postfix >= 2.1
BuildArch: noarch
This is tumgreyspf, an external policy checker for the postfix mail
server. It can optionally greylist and/or use spfquery to check SPF
records to determine if email should be accepted by your server.
SPF is information published by the domain owner about what systems may
legitimately send e-mail for the domain. Greylisting takes advantage
of spam and viruses that do not follow the RFCs and retry deliveries on
temporary failure. We use these checks as part of our mail system and
have seen several orders of magnitude reduction in spam, lower system
load, and few problems with legitimate mail getting blocked.
It uses the file-system as it's database, no additional database is
required to use it.
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
# make directories
mkdir -p "$RPM_BUILD_ROOT"/usr/lib/tumgreyspf/
mkdir -p "$RPM_BUILD_ROOT"/var/lib/tumgreyspf/config
mkdir -p "$RPM_BUILD_ROOT"/var/lib/tumgreyspf/data
mkdir -p "$RPM_BUILD_ROOT"/usr/sbin
mkdir -p "$RPM_BUILD_ROOT"/etc/cron.d
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8
# copy over files
for file in tumgreyspf tumgreyspf-clean tumgreyspf-configtest \
tumgreyspf-install tumgreyspf-stat tumgreyspf-addip
cp "$file" "$RPM_BUILD_ROOT"/usr/lib/tumgreyspf/
cp tumgreyspf.conf "$RPM_BUILD_ROOT"/var/lib/tumgreyspf/config/
cp __default__.dist "$RPM_BUILD_ROOT"/var/lib/tumgreyspf/config/__default__
cp tumgreyspf.8 $RPM_BUILD_ROOT/%{_mandir}/man8
# move external programs to /usr/sbin
mv "$RPM_BUILD_ROOT"/usr/lib/tumgreyspf/tumgreyspf-configtest "$RPM_BUILD_ROOT"/usr/sbin
mv "$RPM_BUILD_ROOT"/usr/lib/tumgreyspf/tumgreyspf-stat "$RPM_BUILD_ROOT"/usr/sbin
mv "$RPM_BUILD_ROOT"/usr/lib/tumgreyspf/tumgreyspf-addip "$RPM_BUILD_ROOT"/usr/sbin
# set up crontab
echo '0 0 * * * nobody /usr/lib/tumgreyspf/tumgreyspf-clean' \
# replace pieces in code that need to reflect new directories
cd "$RPM_BUILD_ROOT"/usr/lib/tumgreyspf/
sed 's|^sys.path.append.*|sys.path.append("/usr/lib/tumgreyspf")|' \
tumgreyspf > && \
cat >tumgreyspf && \
rm -f
sed 's|^defaultConfigFilename.*|defaultConfigFilename = "/var/lib/tumgreyspf/config/tumgreyspf.conf"|' \ > && \
cat > && \
rm -f
cd "$RPM_BUILD_ROOT"/usr/sbin/
sed 's|^sys.path.append.*|sys.path.append("/usr/lib/tumgreyspf")|' \
tumgreyspf-clean > && \
cat >tumgreyspf-clean && \
rm -f
sed 's|^sys.path.append.*|sys.path.append("/usr/lib/tumgreyspf")|' \
tumgreyspf-stat > && \
cat >tumgreyspf-stat && \
rm -f
sed 's|^my .base_dir*|my $base_dir = q(/var/lib/tumgreyspf/config/client_address);|' \
tumgreyspf-addip > && \
cat >tumgreyspf-addip && \
rm -f
cd "$RPM_BUILD_ROOT"/var/lib/tumgreyspf/config/
sed 's|^spfqueryPath.*|spfqueryPath = "/usr/bin/spfquery"|' \
tumgreyspf.conf | \
sed 's|^greylistDir.*|greylistDir = "/var/lib/tumgreyspf/data"|' | \
sed 's|^configPath.*|configPath = "file:///var/lib/tumgreyspf/config"|' \
> && \
cat >tumgreyspf.conf && \
rm -f
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
%dir /var/lib/tumgreyspf
%dir /var/lib/tumgreyspf/config
%config /var/lib/tumgreyspf/config/tumgreyspf.conf
%config /var/lib/tumgreyspf/config/__default__
%attr(700,nobody,root) /var/lib/tumgreyspf/data
%attr(644,root,root) /etc/cron.d/tumgreyspf
Jump to Line
Something went wrong with that request. Please try again.