%global commit c2b451e028b95e87cf9723ca8ade52e280bfe97d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global dovecotversion %(/usr/bin/rpm --queryformat "%{VERSION}" -q dovecot-devel | tr -d ".") %global requireddovecot %(/usr/bin/rpm --queryformat "%{EPOCH}:%{VERSION}-%{RELEASE}" -q dovecot-devel) Name: dovecot-antispam Version: 2.0_%{dovecotversion} Release: 1%{?dist} Summary: The dovecot antispam plugin Group: System Environment/Libraries License: GPLv2 URL: http://johannes.sipsolutions.net/Projects/%{name} Source0: http://git.sipsolutions.net/?p=%{name}.git;a=snapshot;h=%{shortcommit};sf=tgz#/%{name}-%{shortcommit}.tar.gz Requires: dovecot = %{requireddovecot} BuildRequires: dovecot-devel BuildRequires: dovecot BuildRequires: rpm %description The dovecot antispam plugin watches a defined spam folder (defaults to "SPAM"). It works together with a spam system that classifies each message as it is delivered. When the message is classified as spam, it shall be delivered to the spam folder, otherwise via the regular filtering file the user may have (maildrop, sieve, ...). Now the user has everything classified as spam in the special spam folder, everything else where it should be sorted to. This is not enough because our spam scanner needs training. We'll occasionally have false positives and false negatives. Now this is the point where the dovecot antispam plugin comes into play. Instead of moving mail into special folders or forwarding them to special mail addresses for retraining, the plugin offers two actions for the user: 1. moving mail out of the SPAM folder and 2. moving mail into the SPAM folder. The dovecot plugin watches these actions (and additionally prohibits APPENDs to the SPAM folder, more for technical reasons than others) and tells the spam classifier that it made an error and needs to re-classify the message (as spam/not spam depending on which way it was moved.) %prep %setup -qn %{name}-%{shortcommit} %build CFLAGS="${CFLAGS:-%optflags}" make %{?_smp_mflags} %install echo Required dovecot version is %{requireddovecot} install -d %{buildroot}%{_libdir}/dovecot/imap make %{?_smp_mflags} install DESTDIR=%{buildroot} moduledir=%{_libdir}/dovecot install -m0644 -p -D antispam.7 %{buildroot}%{_mandir}/man7/antispam.7 %files %doc NOTES README %license COPYING %{_libdir}/dovecot/imap/lib90_antispam_plugin.so %{_mandir}/man7/antispam.7.gz %changelog * Mon Jan 21 2019 Patrick Pichon - Refresh git and get version from Jan 21. * Fri Jul 21 2017 Patrick Pichon - manage the interdependency with dovecot version. * Mon Oct 26 2015 Scott K Logan - 2.0-1 - Initial package