diff --git a/README.md b/README.md index d5c7e1f..c797ef8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # postgrey +A Postfix policy server for greylisting. + diff --git a/postgrey.service b/postgrey.service new file mode 100644 index 0000000..2e9d601 --- /dev/null +++ b/postgrey.service @@ -0,0 +1,18 @@ +[Unit] +Description=Postfix Greylisting Service +Before=postfix.service + +[Service] +Type=forking +PIDFile=/run/postgrey/postgrey.pid +ExecStart=/usr/bin/postgrey --inet=127.0.0.1:10030 \ + --pidfile=/run/postgrey/postgrey.pid \ + --group=postgrey --user=postgrey \ + --daemonize \ + --greylist-text="Greylisted for %%s seconds" +Restart=always +RestartSec=5 +TimeoutSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/postgrey.spec b/postgrey.spec new file mode 100644 index 0000000..0f6d0d6 --- /dev/null +++ b/postgrey.spec @@ -0,0 +1,90 @@ +%define groupid 65060 +%define userid 65060 +Name: postgrey +Version: 1.37 +Release: 1mamba +Summary: A Postfix policy server for greylisting +Group: System/Servers +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://www.howtoforge.com/greylisting_postfix_postgrey +Source: https://postgrey.schweikert.ch/pub/postgrey-%{version}.tar.gz +Source1: postgrey.service +Source2: postgrey.tmpfiles +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: libperl +BuildRequires: perl-BerkeleyDB +BuildRequires: perl-Net-DNS +BuildRequires: perl-Net-Server +BuildRequires: perl-NetAddr-IP +BuildRequires: perl-devel +## AUTOBUILDREQ-END +Requires: perl +Requires: perl-Net-Server +Requires: perl-IO-Multiplex +Requires: perl-Net-DNS +Requires: perl-NetAddr-IP +Requires: perl-BerkeleyDB +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +A Postfix policy server for greylisting. + +%prep +%setup -q + +%build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +install -D -m0755 postgrey %{buildroot}%{_bindir}/postgrey +install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/postgrey.service +install -D -m0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/postgrey.conf +install -D -m0755 contrib/postgreyreport %{buildroot}%{_bindir}/postgreyreport +install -D -m0644 postgrey_whitelist_recipients %{buildroot}%{_sysconfdir}/postfix/postgrey_whitelist_recipients +install -D -m0644 postgrey_whitelist_clients %{buildroot}%{_sysconfdir}/postfix/postgrey_whitelist_clients + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%pre +/usr/sbin/groupadd postgrey -g %{groupid} 2>/dev/null +/usr/sbin/useradd -u %{userid} -c 'Postgrey user' -d /dev/null -g postgrey \ + -s /bin/true postgrey 2>/dev/null +: + +%preun +%systemd_preun postgrey +# erase +if [ $1 -eq 0 ]; then + /usr/sbin/userdel postgrey 2>/dev/null + /usr/sbin/groupdel postgrey 2>/dev/null +fi +: + +%post +/sbin/ldconfig +%tmpfiles_create postgrey.conf +%systemd_post postgrey +: + +%postun +/sbin/ldconfig +%systemd_postun_with_restart postgrey +: + +%files +%defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/postfix/postgrey_whitelist_clients +%config(noreplace) %{_sysconfdir}/postfix/postgrey_whitelist_recipients +%{_bindir}/postgrey +%{_bindir}/postgreyreport +%{_tmpfilesdir}/postgrey.conf +%{_unitdir}/postgrey.service +%doc COPYING + +%changelog +* Wed Aug 14 2019 Silvan Calarco 1.37-1mamba +- package created using the webbuild interface diff --git a/postgrey.tmpfiles b/postgrey.tmpfiles new file mode 100644 index 0000000..b79d18f --- /dev/null +++ b/postgrey.tmpfiles @@ -0,0 +1,2 @@ +d /var/spool/postfix/postgrey/ 0755 postgrey postgrey - +d /run/postgrey 0755 postgrey postgrey -