From 0f06bbca1096e9a8ab16cf42615f30663f86ffc9 Mon Sep 17 00:00:00 2001 From: Christopher Meng Date: Jan 12 2014 16:32:52 +0000 Subject: Update systemd unit files by adding 3 extra options and 1 new entry for documentation. SPEC cleanup, useradd operation is optimized. Missing dependencies first try by perl magic R. Delete tmpfiles commit since it's nonsense. --- diff --git a/postgrey-tmpfiles.conf b/postgrey-tmpfiles.conf deleted file mode 100644 index 19c61d1..0000000 --- a/postgrey-tmpfiles.conf +++ /dev/null @@ -1 +0,0 @@ -d /var/run/postgrey 0755 postgrey postgrey - diff --git a/postgrey.service b/postgrey.service index 4cb5ede..7dd3425 100644 --- a/postgrey.service +++ b/postgrey.service @@ -1,5 +1,6 @@ [Unit] Description=Postfix Greylisting Service +Documentation=man:postgrey(8) Before=postfix.service [Service] @@ -13,11 +14,15 @@ PIDFile=/var/run/postgrey.pid ExecStart=/usr/sbin/postgrey \ --unix=/var/spool/postfix/postgrey/socket \ --pidfile=/var/run/postgrey.pid \ + --group=postgrey \ + --user=postgrey \ + --greylist-text="Greylisted for %%s seconds" --daemonize \ $POSTGREY_OPTS Restart=always RestartSec=1 +TimeoutSec=5 [Install] WantedBy=multi-user.target diff --git a/postgrey.spec b/postgrey.spec index a615fad..5e140d1 100644 --- a/postgrey.spec +++ b/postgrey.spec @@ -2,7 +2,7 @@ Name: postgrey Version: 1.34 -Release: 8%{?dist} +Release: 9%{?dist} # File headers only state "GNU GPL", but the LICENSE sections state v2 and "any # later version" Summary: Postfix Greylisting Policy Server @@ -12,13 +12,12 @@ Source0: http://postgrey.schweikert.ch/pub/postgrey-%{version}.tar.gz Source1: postgrey.service Source2: README-rpm Source3: postgrey.sysconfig -Source4: postgrey-tmpfiles.conf Patch0: postgrey-1.28-group.patch Patch1: postgrey-1.34-perl-5.18.patch BuildArch: noarch BuildRequires: systemd -# We require postfix for its directories and gid Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +# We require postfix for its directories and gid Requires: postfix Requires(pre): shadow-utils Requires(post): systemd @@ -26,9 +25,9 @@ Requires(preun): systemd Requires(postun): systemd %description -Postgrey is a Postfix policy server implementing greylisting. When a request +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 +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. @@ -77,13 +76,12 @@ install -pDm0644 postgrey.8 \ install -pDm0755 contrib/postgreyreport \ %{buildroot}%{_sbindir}/postgreyreport -# Tmpfiles.d -mkdir -p %{buildroot}%{_tmpfilesdir} -install -m0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf - %pre -/usr/sbin/useradd -d %{_localstatedir}/spool/postfix/postgrey -s /sbin/nologin \ - -M -r postgrey &>/dev/null || : +getent group postgrey >/dev/null || groupadd -r postgrey +getent passwd postgrey >/dev/null || \ + useradd -r -g postgrey -d %{_localstatedir}/spool/postfix/postgrey -s /sbin/nologin \ + -c "Postfix Greylisting Service" postgrey +exit 0 %post %systemd_post postgrey.service @@ -107,8 +105,6 @@ install -m0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf %files %doc Changes COPYING README README-rpm %{_unitdir}/postgrey.service -%{_tmpfilesdir}/postgrey.conf -%{_localstatedir}/run/postgrey %{_sysconfdir}/sysconfig/postgrey %config(noreplace) %{confdir}/postgrey_whitelist_clients %config(noreplace) %{confdir}/postgrey_whitelist_recipients @@ -119,6 +115,10 @@ install -m0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf %dir %attr(0751,postgrey,postfix) %{_localstatedir}/spool/postfix/postgrey/ %changelog +* Sat Jan 11 2014 Christopher Meng - 1.34-9 +- Update systemd service unit to be more powerful. +- SPEC cleanup(BZ#850279). + * Wed Jan 01 2014 Nils Philippsen - 1.34-8 - make postgrey work with perl 5.18 (#1039551)