File postgrey.spec of Package postgrey
#
# spec file for package postgrey (Version 1.31)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: postgrey
Requires: perl >= 5.6.0, perl-BerkeleyDB perl-IO-Multiplex perl-Net-Server
%if 0%{?suse_version} >= 1000
Suggests: cron
%endif
# PreReq: %insserv_prereq, %fillup_prereq /usr/sbin/useradd
PreReq: /usr/sbin/useradd
License: GPL v2 or later
Group: Productivity/Networking/Email/Utilities
Summary: Postfix greylisting policy server
Version: 1.34
Release: 9.1
Url: http://postgrey.schweikert.ch/
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: http://postgrey.schweikert.ch/pub/%name-%{version}.tar.bz2
Source1: %{name}.init
Source2: %{name}.sysconfig
Source3: %{name}.README.SUSE
Source4: %{name}_daily_greylist.crontab
Source5: http://lists.ee.ethz.ch/p/postgrey_clients_dump
Patch0: %{name}-1.33-config.patch
Patch1: %{name}-1.31-goupid.patch
Patch2: postgrey_clients_dump.patch
Packager: Peer Heinlein <p.heinlein@heinlein-support.de>
%description
Postgrey is a Postfix policy server implementing greylisting. When a
request for delivery of a mail is received by Postfix via SMTP, the
triplet CLIENT_IP / SENDER / RECIPIENT is built. If it is the first
time that this triplet is seen, or if the triplet was first seen less
than 5 minutes, then the mail gets rejected with a temporary error.
Hopefully spammers or viruses will not try again later, as it is
however required per RFC.
The following features compared with greylist.pl from Postfix 2.1.1 are
new: Safe database, automatic maintenance, whitelists, lookup by
subnet, auto-whitelisting of clients, only Berkeley DB and no large
mysql nor postgresql DB needed.
This version uses just existing directories from Postfix to follow the
intention of Postfix's author Wieste Venema and postgrey's author
David Schweikert.
Authors:
--------
David Schweikert <david@schweikert.ch>
%prep
%setup
cp %{SOURCE5} .
#%patch0 -p1
#%patch1 -p1
#%patch2 -p0
cp %{SOURCE3} README.SUSE
%build
pod2man -s 8 postgrey > postgrey.8
pod2man -s 8 contrib/postgreyreport > postgreyreport.8
%install
# the binaries
install -d %{buildroot}/%{_sbindir}
install -m 0755 postgrey %{buildroot}/%{_sbindir}/%{name}
install -m 0755 contrib/postgreyreport %{buildroot}/%{_sbindir}/postgreyreport
# manual
install -d %{buildroot}/%{_mandir}/man8
install -m 0644 %{name}.8 %{buildroot}%{_mandir}/man8/%{name}.8
install -m 0644 postgreyreport.8 %{buildroot}%{_mandir}/man8/postgreyreport.8
# configuration
install -d %{buildroot}/%{_sysconfdir}/postfix
install -m 0644 postgrey_whitelist_clients %{buildroot}/%{_sysconfdir}/postfix/postgrey_whitelist_clients
install -m 0644 postgrey_whitelist_recipients %{buildroot}/%{_sysconfdir}/postfix/postgrey_whitelist_recipients
touch postgrey_whitelist_clients.local
install -m 0644 postgrey_whitelist_clients.local %{buildroot}/%{_sysconfdir}/postfix/postgrey_whitelist_clients.local
# init file and configuration
install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/%{name}
ln -sf /etc/init.d/%{name} $RPM_BUILD_ROOT/usr/sbin/rc%{name}
install -D -m 644 %{SOURCE2} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
# queue directory
install -d %{buildroot}/%{_var}/lib/%{name}
# directory for database
install -d -m 0775 %{buildroot}/%{_var}/spool/postfix/postgrey
# some helper tools
install -D -m 0755 postgrey_clients_dump %{buildroot}/usr/bin/postgrey_clients_dump
install -m 0644 %{SOURCE4} .
%pre
/usr/sbin/useradd --system -g nogroup -s /bin/false -c "Postgrey Daemon" -d /var/lib/%{name} %{name} 2> /dev/null || :
%preun
%stop_on_removal %{name}
%post
%{fillup_and_insserv %{name}}
%postun
%restart_on_update %{name}
%{insserv_cleanup}
%verifyscript
%files
%defattr(-,root,root)
%dir %{_sysconfdir}/postfix
%config(noreplace) %{_sysconfdir}/postfix/postgrey_whitelist_recipients
%config(noreplace) %{_sysconfdir}/postfix/postgrey_whitelist_clients
%config(noreplace) %{_sysconfdir}/postfix/postgrey_whitelist_clients.local
%config %attr(0755,root,root) /etc/init.d/%{name}
%{_sbindir}/%{name}
%{_sbindir}/postgreyreport
%{_sbindir}/rc%{name}
/usr/bin/postgrey_clients_dump
%dir %attr(0755,postgrey,postfix) %{_var}/lib/%{name}
/var/adm/fillup-templates/sysconfig.%{name}
%dir %attr(0755,postfix,postfix) %{_var}/spool/postfix
%dir %attr(0770,postgrey,postfix) %{_var}/spool/postfix/%{name}
%doc %{_mandir}/man?/*
%doc Changes COPYING README README.SUSE %{name}_daily_greylist.crontab
%changelog
* Sun Nov 15 2008 pheinlein@heinlein-support.de
- directory for socket moved frm /var/lib/postgrey to /var/spool/postfix/postgrey/socket
- postgrey_whitelist_* moved from /etc/postgrey to /etc/postfix
* Thu Aug 21 2008 kssingvo@suse.de
- fixed specfile: "Suggests:" cannot be used for SLES9
* Wed Aug 20 2008 kssingvo@suse.de
- update to version 1.32:
* fixed recipients whitelisting
* added --syslog-facility option
* add support for BATV
* updated whitelist
* Thu Apr 10 2008 kssingvo@suse.de
- added postgrey_daily_greylist.crontab script
- added postgrey_clients_dump script
* Wed Apr 2 2008 kssingvo@suse.de
- fixes for init file:
* no pid file needed
* sysconfig variable used after sysconfig is read
- sysconfig file:
* fix for location of UNIX-domain socket location
- daemon:
* no more uid postfix needed
* using gid postfix instead (more secure?)
- run:
* postfix subdirectory required for UNIX-domain socket location
- updated README.SUSE: a working version now
* Tue Apr 1 2008 kssingvo@suse.de
- changed init-/sysconfig-file
- updated README.SUSE
* Mon Mar 31 2008 kssingvo@suse.de
- changed system config directories to /etc/postgrey
- using own user (postgrey) for service now
- added small documenation file for SUSE distribution
* Mon Mar 31 2008 kssingvo@suse.de
- initial version 1.31