# # SPEC file for guardian-milter # # Noumenia (C) 2019 www.noumenia.gr # # License: GPLv3 # https://opensource.org/license/gpl-3-0/ # %global gitlab_owner noumenia %global gitlab_name guardian-milter %global gitlab_version 2.1 %global gitlab_commit 9b2a3ebad439829ef4a06b4e8e3cbba3cb97a6e3 %global composer_vendor noumenia %global composer_project guardian-milter # "php": ">=8.0.0" %global php_min_ver 8.0.0 %{!?phpdir: %global phpdir %{_datadir}/php} %{!?licensedir: %global licensedir %{_datadir}/licenses} Name: %{gitlab_name} Version: %{gitlab_version} Release: 1%{?dist} Summary: Multi-purpose security milter. License: GPLv3 URL: https://gitlab.com/noumenia/guardian-milter Source0: %{name}-%{gitlab_version}-%{gitlab_commit}.tar.gz BuildArch: noarch # required for the _unitdir macro BuildRequires: systemd-rpm-macros # composer.json Requires: php(language) >= %{php_min_ver} Requires: php-iconv Requires: php-posix Requires: php-sockets Requires: libMilterPHP >= 2.1 # composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description Guardian-milter is a Postfix/Sendmail milter for filtering various types of fake, phishing and spam emails. The milter executes highly crafted checks and marks incoming emails with a pass/fail header or rejects them during the SMTP dialogue. Features - Add an Authentication-Results header - Copy failed emails to another email address - Reject failed emails during the SMTP conversation - Remove the name part of the From: header - Save failed emails in JSON format - Run regular expressions on the connection (IP/hostname) - Run regular expressions on the HELO/EHLO string - Run regular expressions on the envelope RCTP - Detect domain in the From name - Detect domain in the subject - Detect fake Apple emails - Detect fake banking emails - Detect fake Chanel emails - Detect fake DHL emails - Detect fake ELTA emails - Detect fake Facebook emails - Detect fake LinkedIn emails - Detect fake Louis Vuitton emails - Detect fake Maersk emails - Detect fake password expiration emails - Detect fake PayPal emails - Detect fake USPS emails - Detect fake WeTransfer emails - Reject attachments with known problematic file extensions - AbuseIPDB integration - Block emails based on IP confidence score (AbuseIPDB) - Block emails by country of origin (AbuseIPDB) %prep %setup -qn %{gitlab_name}-%{gitlab_commit} %install # systemd service mkdir -p %{buildroot}%{_unitdir}/ cp -rp guardian-milter.service %{buildroot}%{_unitdir}/ chmod 0644 %{buildroot}%{_unitdir}/guardian-milter.service # the daemon executable mkdir -p %{buildroot}%{_sbindir}/ cp -rp guardian-milter %{buildroot}%{_sbindir}/ # the ini file mkdir -p %{buildroot}%{_sysconfdir}/ cp -rp gu-milter.ini %{buildroot}%{_sysconfdir}/ # libraries mkdir -p %{buildroot}%{phpdir}/%{name}/ cp -rp controller %{buildroot}%{phpdir}/%{name}/ cp -rp interface %{buildroot}%{phpdir}/%{name}/ cp -rp library %{buildroot}%{phpdir}/%{name}/ # documentation mkdir -p %{buildroot}%{_docdir}/%{name}/ cp -rp CHANGELOG.md %{buildroot}%{_docdir}/%{name}/ cp -rp composer.json %{buildroot}%{_docdir}/%{name}/ cp -rp README.md %{buildroot}%{_docdir}/%{name}/ # license mkdir -p %{buildroot}%{licensedir}/%{name}/ cp -rp LICENSE %{buildroot}%{licensedir}/%{name}/ # run directory mkdir -p %{buildroot}%{_rundir}/gu-milter %pre # group getent group gu-milter >/dev/null || groupadd -r gu-milter # user getent passwd gu-milter >/dev/null || useradd -r -g gu-milter -d "/run/gu-milter" -M -s /sbin/nologin -c "guardian-milter daemon" gu-milter exit 0 %post if [ $1 -eq 1 ]; then # initial installation systemctl daemon-reload &>/dev/null || : systemctl preset guardian-milter.service &>/dev/null || : fi %preun if [ $1 -eq 0 ]; then # package removal, not upgrade systemctl --no-reload disable guardian-milter.service &>/dev/null || : systemctl stop guardian-milter.service &>/dev/null || : userdel gu-milter fi %postun systemctl daemon-reload &>/dev/null || : if [ $1 -ge 1 ]; then # package upgrade, not uninstall systemctl try-restart guardian-milter.service &>/dev/null || : fi %files # default attributes %defattr(644,root,root,755) # license %license LICENSE # docs %doc CHANGELOG.md README.md composer.json # library %{phpdir}/guardian-milter/ # executable %attr(0755,root,root) %{_sbindir}/guardian-milter # the ini file %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/gu-milter.ini # systemd service %attr(0644,root,root) %{_unitdir}/guardian-milter.service # run directory %dir %attr(0755,gu-milter,gu-milter) %{_rundir}/gu-milter %changelog * Mon Sep 18 2023 Maria Ksanthi - 1.1-1 - Initial package