Blob Blame History Raw
Summary:           Milter to check mails for suspicious Microsoft VBA macro code
Name:              macromilter
Version:           3.4.3
Release:           1%{?dist}
License:           MIT
Source0: {version}/%{name}-%{version}.tar.gz
Source1:           macromilter.service
Source2:           macromilter.logrotate
Source3:           macromilter.tmpfilesd
Source4:           README.fedora
Patch0:            macromilter-3.4.3-var-lib.patch
BuildArch:         noarch
BuildRequires:     python2-devel
BuildRequires:     systemd
Requires(pre):     shadow-utils
Requires(post):    systemd
Requires(preun):   systemd
Requires(postun):  systemd
# No python3-pymilter package yet
%if 0%{?rhel} > 7 || 0%{?fedora} > 27
Requires:          python2-pymilter
Requires:          python-pymilter
Requires:          python2-oletools
%if 0%{?fedora}
Requires:          python2-configparser
Requires:          python-configparser
Provides:          MacroMilter = %{version}-%{release}

Python based milter for Sendmail and Postfix MTA servers to check incoming
e-mails for Microsoft Office attachments. If a Microsoft Office document is
attached to the e-mail, it will be scanned for suspicious VBA macro code.
Files with malicious macros are, depending on configuration, either removed
and replaced by harmless text files or alternatively the whole e-mail will
be rejected.

%setup -q -n MacroMilter-%{version}
cp -pf %{SOURCE4} .
%patch0 -p1 -b .var-lib

# Empty build section, most likely nothing required.

install -D -p -m 755 %{name}/ $RPM_BUILD_ROOT%{_bindir}/%{name}
sed -e '1i #!%{_bindir}/python2' -i $RPM_BUILD_ROOT%{_bindir}/%{name}
touch -c -r %{name}/ $RPM_BUILD_ROOT%{_bindir}/%{name}
install -D -p -m 644 %{name}/config.ini $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.ini
install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
install -D -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf
mkdir -p $RPM_BUILD_ROOT{/run,%{_localstatedir}/{lib,log}}/%{name}/

getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name}
getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "MacroMilter service" %{name}
exit 0

%systemd_post %{name}.service

%systemd_preun %{name}.service

%systemd_postun_with_restart %{name}.service

%doc README.fedora
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/config.ini
%dir %{_sysconfdir}/logrotate.d/
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(0755,%{name},%{name}) /run/%{name}/
%dir %attr(0750,%{name},%{name}) %{_localstatedir}/lib/%{name}/
%dir %attr(0750,%{name},%{name}) %{_localstatedir}/log/%{name}/

* Mon Oct 30 2017 Robert Scheck <> 3.4.3-1
- Upgrade to 3.4.3

* Mon Oct 09 2017 Robert Scheck <> 3.3-1.20171009git4e8295f
- Upgrade to 3.3 (GIT 20171009)

* Sat Oct 07 2017 Robert Scheck <> 3.3-1.20171007giteae1667
- Upgrade to 3.3 (GIT 20171007)
- Initial spec file for Fedora and Red Hat Enterprise Linux