From 3fb603a837e185537d2a9c10a9fcf773c1a282df Mon Sep 17 00:00:00 2001 From: Christopher Meng Date: Nov 13 2015 13:25:32 +0000 Subject: Update to 1.36 (1.35 skipped) - Refine release section of postgrey manpage. - Refine configuration instructions. --- diff --git a/.gitignore b/.gitignore index ec15fa9..7c3118a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ postgrey-1.32.tar.gz /postgrey-1.34.tar.gz +/postgrey-1.36.tar.gz diff --git a/README-rpm b/README-rpm index a06f52c..7e3f3cb 100644 --- a/README-rpm +++ b/README-rpm @@ -1,21 +1,34 @@ -To make use of postgrey, edit your configuration files: +1. To make use of postgrey in postfix, edit postfix configuration file: /etc/postfix/main.cf: smtpd_recipient_restrictions = ... check_policy_service unix:postgrey/socket, ... - -Or if you like to use inet sockets (modify the IP if needed): +Or if TCP sockets (modify IP / port if needed) is preferred, first change +POSTGREY_TYPE: /etc/sysconfig/postgrey: - options="--inet=127.0.0.1:10023" + POSTGREY_TYPE="--inet=127.0.0.1:10023" + +then modify postfix configuration file: /etc/postfix/main.cf: smtpd_recipient_restrictions = ... check_policy_service inet:127.0.0.1:10023, ... -And don't forget to activate the service on startup! +After above steps, please restart the postfix service to make sure postfix has +loaded the changes. And don't forget to activate the service on startup! + +2. If --privacy option is passed to postgrey in /etc/sysconfig/postgrey, make +sure perl(Digest::SHA) is installed, using dnf to install if not available: + + dnf install perl\(Digest::SHA\) + +Don't forget to escape the parentheses if other perl modules are absent. +3. Postgrey could be used with exim if you want, but need to modify the +systemd service file like removing the dependency of postfix.service. More +details in README.exim underneath /usr/share/doc/postgrey. diff --git a/postgrey.service b/postgrey.service index 01df702..9da9c13 100644 --- a/postgrey.service +++ b/postgrey.service @@ -5,18 +5,17 @@ Before=postfix.service [Service] Type=forking - EnvironmentFile=-/etc/sysconfig/postgrey ExecStartPre=-/bin/rm -f /var/run/postgrey.pid PIDFile=/var/run/postgrey.pid - ExecStart=/usr/sbin/postgrey \ - --unix=/var/spool/postfix/postgrey/socket \ - --pidfile=/var/run/postgrey.pid \ - --group=postgrey \ - --user=postgrey \ + $POSTGREY_TYPE \ + $POSTGREY_PID \ + $POSTGREY_GROUP \ + $POSTGREY_USER \ '--greylist-text=Greylisted for %%s seconds' \ --daemonize \ + $POSTGREY_DELAY \ $POSTGREY_OPTS Restart=always diff --git a/postgrey.spec b/postgrey.spec index 7ae5832..837d23e 100644 --- a/postgrey.spec +++ b/postgrey.spec @@ -1,8 +1,8 @@ %global confdir %{_sysconfdir}/postfix Name: postgrey -Version: 1.34 -Release: 17%{?dist} +Version: 1.36 +Release: 1%{?dist} # File headers only state "GNU GPL", but the LICENSE sections state v2 and "any # later version" Summary: Postfix Greylisting Policy Server @@ -12,12 +12,11 @@ Source0: http://postgrey.schweikert.ch/pub/postgrey-%{version}.tar.gz Source1: postgrey.service Source2: README-rpm Source3: postgrey.sysconfig -Patch0: postgrey-1.28-group.patch -Patch1: postgrey-1.34-perl-5.18.patch BuildArch: noarch BuildRequires: perl-podlators BuildRequires: systemd Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +## Note: If --privacy specified, perl(Digest::SHA) will be needed. #Requires: perl(BerkeleyDB) #Requires: perl(Fcntl) #Requires: perl(Getopt::Long) @@ -29,8 +28,8 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $ve #Requires: perl(strict) #Requires: perl(Sys::Hostname) #Requires: perl(Sys::Syslog) -# We require postfix for its directories and gid -Requires: postfix +# Requiring postfix for its directories and GID. +Recommends: postfix Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd @@ -46,45 +45,48 @@ again later, as it is however required per RFC. %prep %setup -q -%patch0 -p1 -b .group -%patch1 -p1 -b .perl-5.18 -install -pm0644 %{SOURCE2} README-rpm +# Set default group tp postgrey. +sed -i 's|nogroup|postgrey|g' postgrey +# No perldoc, man is enough. +sed -i 's|POD ||g;s|perldoc|man|g' README +install -pm0644 %{SOURCE2} README.Fedora %build -# We only have perl scripts, so just "build" the man page +# We only have perl scripts, so just "build" the man page. pod2man \ --center="Postgrey Policy Server for Postfix" \ --section="8" \ + --release="Postgrey %{version}" \ postgrey > postgrey.8 %install -# Configuration files +# Configuration files. mkdir -p %{buildroot}%{confdir} install -pm0644 postgrey_whitelist_{clients,recipients} \ %{buildroot}%{confdir}/ -# Local whitelist file +# Local whitelist file. echo "# Clients that should not be greylisted. See postgrey(8)." \ > %{buildroot}%{confdir}/postgrey_whitelist_clients.local -# Main script +# Main script. install -pDm0755 postgrey %{buildroot}%{_sbindir}/postgrey -# Spool directory +# Spool directory. mkdir -p %{buildroot}%{_localstatedir}/spool/postfix/postgrey -# Init script +# Systemd service. install -pDm0644 %{SOURCE1} \ %{buildroot}%{_unitdir}/postgrey.service -# Sysconfig +# Sysconfig file. install -pDm0644 %{SOURCE3} \ %{buildroot}%{_sysconfdir}/sysconfig/postgrey -# Man page +# Manpage. install -pDm0644 postgrey.8 \ %{buildroot}%{_mandir}/man8/postgrey.8 -# Optional report script +# Optional report script. install -pDm0755 contrib/postgreyreport \ %{buildroot}%{_sbindir}/postgreyreport @@ -115,7 +117,8 @@ exit 0 /bin/systemctl try-restart postgrey.service >/dev/null 2>&1 || : %files -%doc Changes COPYING README README-rpm +%doc Changes README README.exim README.Fedora +%license COPYING %{_unitdir}/postgrey.service %{_sysconfdir}/sysconfig/postgrey %config(noreplace) %{confdir}/postgrey_whitelist_clients @@ -127,6 +130,11 @@ exit 0 %dir %attr(0751,postgrey,postfix) %{_localstatedir}/spool/postfix/postgrey/ %changelog +* Fri Sep 04 2015 Christopher Meng - 1.36-1 +- Update to 1.36 (1.35 skipped) +- Refine release section of postgrey manpage. +- Refine configuration instructions. + * Thu Jun 18 2015 Fedora Release Engineering - 1.34-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/postgrey.sysconfig b/postgrey.sysconfig index f735afd..1074c68 100644 --- a/postgrey.sysconfig +++ b/postgrey.sysconfig @@ -1 +1,25 @@ -POSTGREY_OPTS="--delay=60" +# Postgrey offers 2 listening types, --inet and --unix. As default, Fedora +# postgrey works under UNIX socket, but, changing to TCP socket on user's own +# is also available, for instance, let it work at 10023 port of localhost: +# --inet=10023 +# To be more detailed, there is another way if you still run it at localhost: + --inet=127.0.0.1:10023 +POSTGREY_TYPE="--unix=/var/spool/postfix/postgrey/socket" + +# If postgrey works under UNIX socket way, PID file can be specified to +# custom location, note that no need to set this if postgrey is working +# under TCP socket way. +POSTGREY_PID="--pidfile=/var/run/postgrey.pid" + +# Name of group which postgrey belongs, default is postgrey +POSTGREY_GROUP="--group=postgrey" + +# Name of user which postgrey belongs, default is postgrey +POSTGREY_USER="--user=postgrey" + +# DELAY +POSTGREY_DELAY="--delay=60" + +# For more options can be used, please read manpage or execute `postgrey -h`. +# Custom options. +POSTGREY_OPTS="" diff --git a/sources b/sources index 257cc49..fbeefa5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f736a7be1094593f1a66cd13f32b39ef postgrey-1.34.tar.gz +eb4c9426347851d45cdb51e396745a66 postgrey-1.36.tar.gz