commit d2f357dd4f778d228149341d74114950b5164104c4112d44885a6f550d845ad6 Author: Dirk Stoecker Date: Wed Feb 9 07:34:01 2022 +0000 Accepting request 952862 from home:weberho:qmailtoaster Superseeded request #952097, updated README. OBS-URL: https://build.opensuse.org/request/show/952862 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Mail-SpamAssassin-Plugin-dqs?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README-SUSE.md b/README-SUSE.md new file mode 100644 index 0000000..afd1b0c --- /dev/null +++ b/README-SUSE.md @@ -0,0 +1,32 @@ +Usage of spamhaus/spamassassin-dqs +================================== + +Check, if HBL is enabled for your query-key, execute `hbltest.sh` and +enter your query key. +If HBL is disabled, replace sh_hbl.cf and sh_hbl_scores.cf by empty content: +``` +echo '' > /etc/mail/spamassassin/sh_hbl.cf +echo '' > /etc/mail/spamassassin/sh_hbl_scores.cf +``` + +To allow network queries via the DQS plugin, the local-only configuration from +/etc/sysconfig/spamd must be removed by removing the '-L' parameter: +``` +sed -e 's/^\(SPAMD_ARGS="-d -c\) -L"/\1"/' -i /etc/sysconfig/spamd +``` + + +Add your query key into the configuration files. +Use you personal key instead of the example's key!: +``` +for FILE in /etc/mail/spamassassin/sh*.cf +do sed -e 's/your_DQS_key/aip7yig6sahg6ehsohn5shco3z/g' -i $FILE ; done +``` + + +After restarting spamd by executing `systemctl restart spamd.service`, your +Spamaccassin daemon will query Spamhaus Servers. +It's highlly recommended to run the "Spamhaus Blocklist Tester" to check if +your configuration works as expected. Be aware, that some mails will blocked +on SMTP level, others are tagged as spam and others will only have spam headers +set depending on your configuration. diff --git a/perl-Mail-SpamAssassin-Plugin-dqs.changes b/perl-Mail-SpamAssassin-Plugin-dqs.changes new file mode 100644 index 0000000..5188e29 --- /dev/null +++ b/perl-Mail-SpamAssassin-Plugin-dqs.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Sun Feb 6 09:02:01 UTC 2022 - Johannes Weberhofer + +- spamassassin-dqs version 1.2.0 diff --git a/perl-Mail-SpamAssassin-Plugin-dqs.spec b/perl-Mail-SpamAssassin-Plugin-dqs.spec new file mode 100644 index 0000000..0ef613d --- /dev/null +++ b/perl-Mail-SpamAssassin-Plugin-dqs.spec @@ -0,0 +1,84 @@ +# +# spec file for package perl-Mail-SpamAssassin-Plugin-dqs +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: perl-Mail-SpamAssassin-Plugin-dqs +Version: 1.2.0 +Release: 0 +Summary: SpamAssassin plugin for Spamhaus Data Query Service (DQS) +License: Apache-2.0 +Group: Development/Libraries/Perl +URL: https://github.com/spamhaus/spamassassin-dqs/tags +Source0: https://github.com/spamhaus/spamassassin-dqs/archive/refs/tags/v%{version}.tar.gz +Source1: README-SUSE.md +BuildRequires: spamassassin >= 3.4.1 +Requires: spamassassin >= 3.4.1 +%{perl_requires} + +%description +The Spamhaus Data Query Service (DQS) plugin for SpamAssassin enhances +existing functions by checking HELO/EHLO, From, Reply-To, Envelope-From +and Return-Path against Spamhaus DBL/ZRD blacklists. It also scans the +e-mail body for e-mail addresses and performs blacklist lookups against +the domains or its authoritative nameservers. Further checks cover the +reverse DNS matches in DBL/ZRD blacklists or the SBL/CSS lookups for IP +addresses or IP addresses of authoritative nameservers of domains being +part of the e-mail body. + +While the DQS usage is free under the same terms like when using public +mirrors (which are shipped in SpamAssassin as default configuration), a +registration procedure for a free DQS key is mandatory nevertheless. + +%prep +%setup -q -n spamassassin-dqs-%{version} +sed -e 's||%{perl_vendorlib}/Mail/SpamAssassin/Plugin|' -i sh.pre +cp %{SOURCE1} . + +%build + +%install +install -D -p -m 0644 SH.pm %{buildroot}%{perl_vendorlib}/Mail/SpamAssassin/Plugin/SH.pm +mkdir -p %{buildroot}/%{_bindir} +install -m 0755 hbltest.sh %{buildroot}%{_bindir}/hbltest.sh +for FILE in sh.pre sh.cf sh_hbl.cf sh_hbl_scores.cf sh_scores.cf ; do + install -D -p -m 0644 $FILE %{buildroot}%{_sysconfdir}/mail/spamassassin/$FILE +done + +%check +# setup config files +mkdir tests +cp %{_sysconfdir}/mail/spamassassin/* tests/ +for FILE in sh.pre sh.cf sh_scores.cf ; do + cp $FILE tests/ +done +sed -e 's|%{perl_vendorlib}|%{buildroot}%{perl_vendorlib}|' -i tests/sh.pre +# execute the tests +spamassassin --siteconfigpath=tests --lint > tests/lint.log 2>&1 || { cat tests/lint.log; exit 1; } +grep -q -i fail tests/lint.log && { cat tests/lint.log; exit 1; } || : + +%files +%doc Changelog.md NOTICE README.md README-SUSE.md +%license LICENSE +%config(noreplace) %{_sysconfdir}/mail/spamassassin/sh.cf +%config(noreplace) %{_sysconfdir}/mail/spamassassin/sh.pre +%config(noreplace) %{_sysconfdir}/mail/spamassassin/sh_hbl.cf +%config(noreplace) %{_sysconfdir}/mail/spamassassin/sh_hbl_scores.cf +%config(noreplace) %{_sysconfdir}/mail/spamassassin/sh_scores.cf +%{perl_vendorlib}/Mail/SpamAssassin/Plugin/SH.pm +%{_bindir}/hbltest.sh + +%changelog diff --git a/v1.2.0.tar.gz b/v1.2.0.tar.gz new file mode 100644 index 0000000..b48a193 --- /dev/null +++ b/v1.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d31d23a7f34d22e476f79aa2eff48b1f9544d35bf01f2b93ce2cfbe6c9cae30 +size 21954