Merge ~mirespace/ubuntu/+source/libmail-dmarc-perl:fix-dmarc-receive into ubuntu/+source/libmail-dmarc-perl:ubuntu/noble-devel
- Git
- lp:~mirespace/ubuntu/+source/libmail-dmarc-perl
- fix-dmarc-receive
- Merge into ubuntu/noble-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | git-ubuntu bot | ||||
Approved revision: | not available | ||||
Merged at revision: | a0dab64ea634bb35ef4c680ae2deb54c7040857f | ||||
Proposed branch: | ~mirespace/ubuntu/+source/libmail-dmarc-perl:fix-dmarc-receive | ||||
Merge into: | ubuntu/+source/libmail-dmarc-perl:ubuntu/noble-devel | ||||
Diff against target: |
759 lines (+613/-11) 16 files modified
debian/changelog (+26/-0) debian/control (+14/-11) debian/patches/change-Net-IDN-Encode-by-Net-LibIDN.patch (+72/-0) debian/patches/series (+2/-0) debian/patches/use-MIME-Entity-and-MIME-Parser-from-libmime-tools-p.patch (+251/-0) debian/tests/control (+4/-0) debian/tests/data/nice/noneok.eml (+23/-0) debian/tests/data/nice/quarok.eml (+23/-0) debian/tests/data/nice/rejectok.eml (+23/-0) debian/tests/data/nice/strictrejectok.eml (+23/-0) debian/tests/data/spam/nodmarc.eml (+22/-0) debian/tests/data/spam/noneko.eml (+21/-0) debian/tests/data/spam/quarko.eml (+21/-0) debian/tests/data/spam/rejectko.eml (+21/-0) debian/tests/data/spam/strictrejectko.eml (+23/-0) debian/tests/splitting-check (+44/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
git-ubuntu bot | Approve | ||
Bryce Harrington (community) | Approve | ||
Canonical Server Reporter | Pending | ||
Daniel Draper | Pending | ||
Review via email: mp+464196@code.launchpad.net |
Commit message
Description of the change
Hi,
ppa for this is
https:/
ppa:mirespace/
package for Noble, suffix ~mirespace10. This is the package that passed the MIR review and security reviews.
Bryce Harrington (bryce) wrote : | # |
Paride Legovini (paride) : | # |
Miriam España Acebal (mirespace) wrote (last edit ): | # |
Polishing the make the changes happen .. on it! Thank you both
Miriam España Acebal (mirespace) wrote (last edit ): | # |
Changes done.
I uploaded the package with this changes to
ppa ppa:mirespace/
https:/
@Paride: I removed the "-series" line ... it was for the series file on d/p, but removing it for avoiding confusion and because it's known to be changed indirectly.
Bryce Harrington (bryce) wrote : | # |
I notice autopkgtest passed on an earlier iteration:
- libmail-
+ ✅ libmail-dmarc-perl on noble for amd64 @ 21.02.24 11:08:26 Log️ 🗒️
+ ✅ libmail-dmarc-perl on noble for arm64 @ 21.02.24 11:08:55 Log️ 🗒️
+ ✅ libmail-dmarc-perl on noble for armhf @ 21.02.24 11:13:34 Log️ 🗒️
+ ✅ libmail-dmarc-perl on noble for i386 @ 21.02.24 11:08:16 Log️ 🗒️
+ ✅ libmail-dmarc-perl on noble for ppc64el @ 21.02.24 11:09:25 Log️ 🗒️
+ ✅ libmail-dmarc-perl on noble for s390x @ 21.02.24 11:39:48 Log️ 🗒️
I've re-triggered on the ~mirespace10 version. Since this MP includes tests it seems well worth doublechecking.
I read through the new test cases. It would be helpful to include a comment or something as to what distinguishes each test email - i.e. that this one tests for missing DMARC, this one handles invalid situation A, this one situation B, etc. That info could be included in the splitting-check test, or even better if it could be included in the test emails themselves (maybe as the body text?)
Do any of the test cases cover the IDN or MIME module changes? If so those would be worth calling out. I'm guessing though that those were drop-in replacements so no new tests were needed... Does the package already have test cases with coverage on the functionality used from those modules?
Is 'ko' in the filenames indicating "! ok"? Or K.O. as in "knocked out!" Clever :-)
Miriam España Acebal (mirespace) wrote (last edit ): | # |
Bryce, I will try to summarize or add the info that I write to the MIR bug about the tests:
we use the data from spamassassin's test :
- d/t/data/nice contains messages that qualifies as PASS due to the DMARC rules (DMARC_PASS) and
- d/t/data/spam contains messages that are market as REJECT, QUARENTINE, MISSING or NONE.
root@
nodmarc.eml noneko.eml quarko.eml rejectko.eml strictrejectko.eml
root@
1.8 DMARC_REJECT DMARC reject policy
root@
1.8 DMARC_REJECT DMARC reject policy
root@
1.2 DMARC_QUAR DMARC quarantine policy
root@
0.0 DMARC_MISSING Missing DMARC policy
root@
0.9 DMARC_NONE DMARC none policy
in a comment at the beginning of the test file.
The names for the filenames used as data in the tests come also from spamassassin's developers... they are the clever ones, and I like both of your interpretations :).
I used, for checking the changes for IDN and MIME dependency changes, the libmail-dmarc-perl building tests themself plus the t/dmarc.t test in spamassassin test suite package (without the implicit net tests on this file) [1]:
$ make test TEST_FILES=
I'm running this also.
I'll put the comment on the test file and I'll post here the results of the test (only the t/dmarc.t I assume that because it has been built, the build tests passed).
[1] https:/
Miriam España Acebal (mirespace) wrote (last edit ): | # |
Checking t/dmarc.t in a lxc vm with this MP package libamil-
# We installed the proper packages we want to test:
root@Ndmarc-
libmail-dmarc-perl:
Installed: 1.20230215-1ubuntu1
Candidate: 1.20230215-1ubuntu1
Version table:
*** 1.20230215-1ubuntu1 500
500 https:/
100 /var/lib/
1.
500 https:/
1.20230215-1 500
500 http://
root@Ndmarc-
spamassassin:
Installed: 4.0.0-8ubuntu5
Candidate: 4.0.0-8ubuntu5+ppa1
Version table:
4.
500 https:/
*** 4.0.0-8ubuntu5 100
100 http://
100 /var/lib/
4.0.0-8ubuntu4 500
500 http://
#preparing tests as stated in t/README:
# step 0
root@Ndmarc-
What email address or URL should be used in the suspected-spam report
text for users who want more information on your filter installation?
(In particular, ISPs should change this to a local Postmaster contact)
default text: [the administrator of that system]
NOTE: settings for "make test" are now controlled using "t/config.dist".
See that file if you wish to customize what tests are run, and how.
checking module dependencies and their versions...
*******
NOTE: the optional Digest::SHA1 module is not installed.
The Digest::SHA1 module is still required by the Razor2 plugin.
Other modules prefer Digest::SHA, which is a Perl base module.
*******
NOTE: the optional Net::LibIDN2 module is not installed.
Newer version of the optional Net::LibIDN module.
Provides mapping between Internationalized Domain Names (IDN) in
Unicode and ASCII-compatible encoding (ACE) for use in DNS and comparisions.
The module is optional, but without it Unicode IDN names found in mail will
not be suitable for DNS queries and welcome/
*******
NOTE: the optional MaxMind::DB::Reader module is not installed.
Used by the RelayCountry plugin (not enabled by default) to
determine the domain country codes of each relay in the path of an email.
Also used by the URILocalBL plugin (not enabled by default) to provide ISP
and Country code based filtering.
*******
NOTE: the optional MaxMind:
Recommended much faster version of the optional MaxMind::DB::Reader module,
used by RelayCountry / URILocalBL plugins...
Miriam España Acebal (mirespace) wrote : | # |
Also, the dependency splitting works as expected:
root@Ndmarc-
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libclass-
libemail-
libfile-
libnet-ip-perl universe
libregexp-
libmail-dmarc-perl universe
Bryce Harrington (bryce) wrote : | # |
Ok, thanks, this looks good!
Miriam España Acebal (mirespace) wrote : | # |
Thanks Bryce for your support and patience! Uploading:
❯ dput ubuntu ../libmail-
D: Setting host argument.
Checking signature on .changes
gpg: ../libmail-
Checking signature on .dsc
gpg: ../libmail-
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading libmail-
Uploading libmail-
Uploading libmail-
Uploading libmail-
Successfully uploaded packages.
git-ubuntu bot (git-ubuntu-bot) wrote : | # |
Approvers: bryce, mirespace
Uploaders: bryce
MP auto-approved
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index 8f886bc..604bfa1 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,29 @@ |
6 | +libmail-dmarc-perl (1.20230215-1ubuntu1) noble; urgency=medium |
7 | + |
8 | + * Promoting libmail-dmarc-perl to main (LP: #2061865). Readjust |
9 | + dependencies to allow inclusion in main, so that spamassassin |
10 | + can start depending on DMARC for stronger spam filtering (LP: #2023971). |
11 | + - d/control: dependencies readjustment: |
12 | + + separate dependencies in the binary package depending on |
13 | + their use. Modules used in validation remain as binary |
14 | + dependencies and the rest, used in reporting, are moved |
15 | + to suggested dependencies. |
16 | + + drop libemail-mime-perl in favor of libmime-tools-perl and |
17 | + libemail-simple-perl (LP: #2030880). |
18 | + + libnet-libidn-perl replaces libnet-idn-encode-perl (LP: #2038929). |
19 | + - d/patches: Some refactors were needed to use libraries already |
20 | + in main that do the same function: |
21 | + + use-MIME-Entity-and-MIME-Parser-from-libmime-tools-p.patch |
22 | + to use libmime-tools-perl instead of Email::MIME (LP: #2030880). |
23 | + + change-Net-IDN-Encode-by-Net-LibIDN.patch (LP: #2038929). |
24 | + - d/tests: |
25 | + + splitting-check: validate our dependencies split through |
26 | + this check. Thanks to Sergio Durigan Jr. for all the fixing here. |
27 | + + data/*.eml: mails used in the test (the same used by spamassassin |
28 | + t/dmarc.t test). |
29 | + |
30 | + -- Miriam España Acebal <miriam.espana@canonical.com> Mon, 11 Dec 2023 16:43:31 +0200 |
31 | + |
32 | libmail-dmarc-perl (1.20230215-1) unstable; urgency=medium |
33 | |
34 | * New upstream version 1.20230215 |
35 | diff --git a/debian/control b/debian/control |
36 | index a3b621c..3ddfcb8 100644 |
37 | --- a/debian/control |
38 | +++ b/debian/control |
39 | @@ -1,5 +1,6 @@ |
40 | Source: libmail-dmarc-perl |
41 | -Maintainer: Noah Meyerhans <noahm@debian.org> |
42 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
43 | +XSBC-Original-Maintainer: Noah Meyerhans <noahm@debian.org> |
44 | Section: perl |
45 | Priority: optional |
46 | Build-Depends: debhelper-compat (= 13) |
47 | @@ -7,11 +8,12 @@ Build-Depends-Indep: perl, |
48 | libconfig-tiny-perl <!nocheck>, |
49 | libfile-sharedir-perl, |
50 | libio-socket-ssl-perl <!nocheck>, |
51 | - libnet-idn-encode-perl, |
52 | - libemail-mime-perl, |
53 | + libnet-libidn-perl, |
54 | libmodule-build-perl, |
55 | libtest-file-sharedir-perl, |
56 | libemail-sender-perl, |
57 | + libemail-simple-perl, |
58 | + libmime-tools-perl, |
59 | libdbix-simple-perl, |
60 | libdbd-sqlite3-perl, |
61 | libtest-exception-perl <!nocheck>, |
62 | @@ -37,28 +39,29 @@ Depends: ${misc:Depends}, |
63 | libconfig-tiny-perl, |
64 | libio-socket-ssl-perl, |
65 | libfile-sharedir-perl, |
66 | + libemail-simple-perl, |
67 | + libmime-tools-perl, |
68 | libnet-dns-perl, |
69 | - libnet-idn-encode-perl, |
70 | + libnet-libidn-perl, |
71 | libnet-ip-perl, |
72 | libnet-ssleay-perl, |
73 | - libemail-mime-perl, |
74 | - libtest-file-sharedir-perl, |
75 | - libemail-sender-perl, |
76 | - libdbix-simple-perl, |
77 | - libdbd-sqlite3-perl, |
78 | - libtest-output-perl, |
79 | libregexp-common-perl, |
80 | libsocket6-perl, |
81 | liburi-perl, |
82 | libxml-libxml-perl, |
83 | publicsuffix, |
84 | -Recommends: |
85 | +Suggests: |
86 | libjson-perl, |
87 | libmail-dkim-perl, |
88 | libnet-http-perl, |
89 | libnet-imap-simple-perl, |
90 | libnet-server-perl, |
91 | libnet-smtps-perl, |
92 | + libdbd-sqlite3-perl, |
93 | + libdbix-simple-perl, |
94 | + libemail-sender-perl, |
95 | + libtest-file-sharedir-perl, |
96 | + libtest-output-perl, |
97 | Description: Perl implementation of DMARC |
98 | Mail::DMARC is a suite of tools for implementing DMARC. It adheres to the |
99 | 2013 DMARC draft, intending to implement every MUST and every SHOULD. |
100 | diff --git a/debian/patches/change-Net-IDN-Encode-by-Net-LibIDN.patch b/debian/patches/change-Net-IDN-Encode-by-Net-LibIDN.patch |
101 | new file mode 100644 |
102 | index 0000000..a1b74c2 |
103 | --- /dev/null |
104 | +++ b/debian/patches/change-Net-IDN-Encode-by-Net-LibIDN.patch |
105 | @@ -0,0 +1,72 @@ |
106 | +Description: use Net::LibIDN libnet-libidn-perl instead |
107 | + of libnet-idn-encode-perl for idn to unicode conversion. |
108 | +Author: Miriam Espana Acebal <miriam.espana@canonical.com> |
109 | +Date: Tue, 9 Jan 2024 13:36:20 +0100 |
110 | +Bug-ubuntu: https://bugs.launchpad.net/bugs/2038929 |
111 | +Forwarded: no |
112 | +--- |
113 | +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
114 | +--- a/lib/Mail/DMARC/Base.pm |
115 | ++++ b/lib/Mail/DMARC/Base.pm |
116 | +@@ -10,7 +10,7 @@ |
117 | + use HTTP::Tiny; |
118 | + use IO::File; |
119 | + use Net::DNS::Resolver; |
120 | +-use Net::IDN::Encode qw/domain_to_unicode/; |
121 | ++use Net::LibIDN qw/idn_to_unicode/; |
122 | + use Net::IP; |
123 | + use Regexp::Common 2013031301 qw /net/; |
124 | + use Socket; |
125 | +@@ -143,7 +143,7 @@ |
126 | + |
127 | + my $public_suffixes = $self->get_public_suffix_list(); |
128 | + |
129 | +- $zone = domain_to_unicode( $zone ) if $zone =~ /xn--/; |
130 | ++ $zone = idn_to_unicode( $zone ) if $zone =~ /xn--/; |
131 | + |
132 | + return 1 if $public_suffixes->{$zone}; |
133 | + |
134 | +--- a/Build.PL |
135 | ++++ b/Build.PL |
136 | +@@ -54,7 +54,7 @@ |
137 | + "MIME::Entity" => 0, |
138 | + "MIME::Parser" => 0, |
139 | + "Net::DNS::Resolver" => 0, |
140 | +- "Net::IDN::Encode" => 0, |
141 | ++ "Net::LibIDN" => 0, |
142 | + "Net::IP" => 0, |
143 | + "Net::SSLeay" => 0, |
144 | + "POSIX" => 0, |
145 | +--- a/META.json |
146 | ++++ b/META.json |
147 | +@@ -55,7 +55,7 @@ |
148 | + "IO::Uncompress::Unzip" : "0", |
149 | + "Mail::Field" : "0", |
150 | + "Mail::Internet" : "0", |
151 | +- "MIME::Entity" : "0", |
152 | ++ "Net::LibIDN" : "0", |
153 | + "MIME::Parser" : "0", |
154 | + "Net::DNS::Resolver" : "0", |
155 | + "Net::IDN::Encode" : "0", |
156 | +--- a/META.yml |
157 | ++++ b/META.yml |
158 | +@@ -132,7 +132,7 @@ |
159 | + IO::Uncompress::Unzip: '0' |
160 | + Mail::Field : '0' |
161 | + Mail::Internet : '0' |
162 | +- MIME::Entity: '0' |
163 | ++ Net::LibIDN': '0' |
164 | + MIME::Parser: '0' |
165 | + Net::DNS::Resolver: '0' |
166 | + Net::IDN::Encode: '0' |
167 | +--- a/Makefile.PL |
168 | ++++ b/Makefile.PL |
169 | +@@ -70,7 +70,7 @@ |
170 | + "IO::Uncompress::Unzip" => 0, |
171 | + "Mail::Field" => 0, |
172 | + "Mail::Internet" => 0, |
173 | +- "MIME::Entity" => 0, |
174 | ++ "Net::LibIDN" => 0, |
175 | + "MIME::Parser" => 0, |
176 | + "Net::DNS::Resolver" => 0, |
177 | + "Net::IDN::Encode" => 0, |
178 | diff --git a/debian/patches/series b/debian/patches/series |
179 | index ff0a249..6cda580 100644 |
180 | --- a/debian/patches/series |
181 | +++ b/debian/patches/series |
182 | @@ -1,3 +1,5 @@ |
183 | 0001-pod-Fix-missing-and-malformed-NAME-headings.patch |
184 | 0005-recommend-system-psl.patch |
185 | skip_network_tests.patch |
186 | +use-MIME-Entity-and-MIME-Parser-from-libmime-tools-p.patch |
187 | +change-Net-IDN-Encode-by-Net-LibIDN.patch |
188 | diff --git a/debian/patches/use-MIME-Entity-and-MIME-Parser-from-libmime-tools-p.patch b/debian/patches/use-MIME-Entity-and-MIME-Parser-from-libmime-tools-p.patch |
189 | new file mode 100644 |
190 | index 0000000..1c50291 |
191 | --- /dev/null |
192 | +++ b/debian/patches/use-MIME-Entity-and-MIME-Parser-from-libmime-tools-p.patch |
193 | @@ -0,0 +1,251 @@ |
194 | +Description: use MIME::Entity and MIME::Parser from libmime-tools-perl |
195 | + instead of libemail-mime-perl |
196 | +Author: Miriam Espana Acebal <miriam.espana@canonical.com> |
197 | +Date: Fri, 1 Dec 2023 23:36:20 +0100 |
198 | +Bug-ubuntu: https://bugs.launchpad.net/bugs/2030880 |
199 | +Forwarded: no |
200 | +--- |
201 | + Build.PL | 3 +- |
202 | + META.json | 3 +- |
203 | + META.yml | 3 +- |
204 | + Makefile.PL | 3 +- |
205 | + lib/Mail/DMARC/Report/Receive.pm | 10 ++-- |
206 | + lib/Mail/DMARC/Report/Send/SMTP.pm | 83 +++++++++++++----------------- |
207 | + 6 files changed, 49 insertions(+), 56 deletions(-) |
208 | + |
209 | +Index: libmail-dmarc-perl/Build.PL |
210 | +=================================================================== |
211 | +--- libmail-dmarc-perl.orig/Build.PL 2023-12-12 13:25:40.554260151 +0100 |
212 | ++++ libmail-dmarc-perl/Build.PL 2023-12-12 13:34:31.661666249 +0100 |
213 | +@@ -35,7 +35,6 @@ |
214 | + "DBD::SQLite" => "1.31", |
215 | + "DBIx::Simple" => "1.35", |
216 | + "Data::Dumper" => 0, |
217 | +- "Email::MIME" => 0, |
218 | + "Email::Sender" => 0, |
219 | + "Email::Sender::Simple" => "1.300032", |
220 | + "Email::Simple" => 0, |
221 | +@@ -50,6 +49,10 @@ |
222 | + "IO::Socket::SSL" => 0, |
223 | + "IO::Uncompress::Gunzip" => 0, |
224 | + "IO::Uncompress::Unzip" => 0, |
225 | ++ "Mail::Field" => 0, |
226 | ++ "Mail::Internet" => 0, |
227 | ++ "MIME::Entity" => 0, |
228 | ++ "MIME::Parser" => 0, |
229 | + "Net::DNS::Resolver" => 0, |
230 | + "Net::IDN::Encode" => 0, |
231 | + "Net::IP" => 0, |
232 | +Index: libmail-dmarc-perl/META.json |
233 | +=================================================================== |
234 | +--- libmail-dmarc-perl.orig/META.json 2023-12-12 13:25:40.554260151 +0100 |
235 | ++++ libmail-dmarc-perl/META.json 2023-12-12 13:36:22.713205589 +0100 |
236 | +@@ -39,7 +39,6 @@ |
237 | + "DBD::SQLite" : "1.31", |
238 | + "DBIx::Simple" : "1.35", |
239 | + "Data::Dumper" : "0", |
240 | +- "Email::MIME" : "0", |
241 | + "Email::Sender" : "0", |
242 | + "Email::Sender::Simple" : "1.300032", |
243 | + "Email::Simple" : "0", |
244 | +@@ -54,6 +53,10 @@ |
245 | + "IO::Socket::SSL" : "0", |
246 | + "IO::Uncompress::Gunzip" : "0", |
247 | + "IO::Uncompress::Unzip" : "0", |
248 | ++ "Mail::Field" : "0", |
249 | ++ "Mail::Internet" : "0", |
250 | ++ "MIME::Entity" : "0", |
251 | ++ "MIME::Parser" : "0", |
252 | + "Net::DNS::Resolver" : "0", |
253 | + "Net::IDN::Encode" : "0", |
254 | + "Net::IP" : "0", |
255 | +Index: libmail-dmarc-perl/META.yml |
256 | +=================================================================== |
257 | +--- libmail-dmarc-perl.orig/META.yml 2023-12-12 13:25:40.554260151 +0100 |
258 | ++++ libmail-dmarc-perl/META.yml 2023-12-12 13:37:35.244866669 +0100 |
259 | +@@ -116,7 +116,6 @@ |
260 | + DBD::SQLite: '1.31' |
261 | + DBIx::Simple: '1.35' |
262 | + Data::Dumper: '0' |
263 | +- Email::MIME: '0' |
264 | + Email::Sender: '0' |
265 | + Email::Sender::Simple: '1.300032' |
266 | + Email::Simple: '0' |
267 | +@@ -131,6 +130,10 @@ |
268 | + IO::Socket::SSL: '0' |
269 | + IO::Uncompress::Gunzip: '0' |
270 | + IO::Uncompress::Unzip: '0' |
271 | ++ Mail::Field : '0' |
272 | ++ Mail::Internet : '0' |
273 | ++ MIME::Entity: '0' |
274 | ++ MIME::Parser: '0' |
275 | + Net::DNS::Resolver: '0' |
276 | + Net::IDN::Encode: '0' |
277 | + Net::IP: '0' |
278 | +Index: libmail-dmarc-perl/Makefile.PL |
279 | +=================================================================== |
280 | +--- libmail-dmarc-perl.orig/Makefile.PL 2023-12-12 13:25:40.554260151 +0100 |
281 | ++++ libmail-dmarc-perl/Makefile.PL 2023-12-12 13:34:47.101606901 +0100 |
282 | +@@ -54,7 +54,6 @@ |
283 | + "DBD::SQLite" => "1.31", |
284 | + "DBIx::Simple" => "1.35", |
285 | + "Data::Dumper" => 0, |
286 | +- "Email::MIME" => 0, |
287 | + "Email::Sender" => 0, |
288 | + "Email::Sender::Simple" => "1.300032", |
289 | + "Email::Simple" => 0, |
290 | +@@ -69,6 +68,10 @@ |
291 | + "IO::Socket::SSL" => 0, |
292 | + "IO::Uncompress::Gunzip" => 0, |
293 | + "IO::Uncompress::Unzip" => 0, |
294 | ++ "Mail::Field" => 0, |
295 | ++ "Mail::Internet" => 0, |
296 | ++ "MIME::Entity" => 0, |
297 | ++ "MIME::Parser" => 0, |
298 | + "Net::DNS::Resolver" => 0, |
299 | + "Net::IDN::Encode" => 0, |
300 | + "Net::IP" => 0, |
301 | +Index: libmail-dmarc-perl/lib/Mail/DMARC/Report/Receive.pm |
302 | +=================================================================== |
303 | +--- libmail-dmarc-perl.orig/lib/Mail/DMARC/Report/Receive.pm 2023-12-12 13:25:40.554260151 +0100 |
304 | ++++ libmail-dmarc-perl/lib/Mail/DMARC/Report/Receive.pm 2023-12-12 13:25:40.538260108 +0100 |
305 | +@@ -6,7 +6,7 @@ |
306 | + |
307 | + use Carp; |
308 | + use Data::Dumper; |
309 | +-use Email::MIME; |
310 | ++use MIME::Parser; |
311 | + use Email::Simple; |
312 | + use Encode; |
313 | + use IO::Uncompress::Unzip; |
314 | +@@ -137,8 +137,10 @@ |
315 | + }; |
316 | + |
317 | + my $rep_type; |
318 | +- foreach my $part ( Email::MIME->new( $email->as_string )->parts ) { |
319 | +- my ($c_type) = split /;/, $part->content_type || ''; |
320 | ++ my $parser = MIME::Parser->new; |
321 | ++ foreach my $part ( $parser->parse_data( $email->as_string )->parts_DFS ) { |
322 | ++ next if defined(!$part->bodyhandle); # something to process |
323 | ++ my ($c_type) = split /;/, $part->effective_type || ''; |
324 | + next if $c_type eq 'text/plain'; |
325 | + if ( $c_type eq 'text/rfc822-headers' ) { |
326 | + warn "TODO: handle forensic reports\n"; ## no critic (Carp) |
327 | +@@ -151,7 +153,7 @@ |
328 | + next; |
329 | + } |
330 | + my $bigger; |
331 | +- my $filename = $part->{ct}{attributes}{name} || ''; |
332 | ++ my $filename = $part->head->recommended_filename || $part->bodyhandle->path || ''; |
333 | + |
334 | + if ( $c_type eq 'application/zip' || $c_type eq 'application/x-zip-compressed' ) { |
335 | + $self->get_submitter_from_filename( $filename ); |
336 | +Index: libmail-dmarc-perl/lib/Mail/DMARC/Report/Send/SMTP.pm |
337 | +=================================================================== |
338 | +--- libmail-dmarc-perl.orig/lib/Mail/DMARC/Report/Send/SMTP.pm 2023-12-12 13:25:40.554260151 +0100 |
339 | ++++ libmail-dmarc-perl/lib/Mail/DMARC/Report/Send/SMTP.pm 2023-12-12 13:25:40.550260140 +0100 |
340 | +@@ -6,7 +6,7 @@ |
341 | + |
342 | + use Carp; |
343 | + use English '-no_match_vars'; |
344 | +-use Email::MIME; |
345 | ++use MIME::Entity; |
346 | + #use Mail::Sender; # something to consider |
347 | + use Sys::Hostname; |
348 | + use POSIX; |
349 | +@@ -115,24 +115,20 @@ |
350 | + sub assemble_too_big_message_object { |
351 | + my ( $self, $to, $body ) = @_; |
352 | + |
353 | +- my @parts = Email::MIME->create( |
354 | +- attributes => { |
355 | +- content_type => "text/plain", |
356 | +- disposition => "inline", |
357 | +- charset => "US-ASCII", |
358 | +- }, |
359 | +- body => $body, |
360 | +- ) or croak "unable to add body!"; |
361 | +- |
362 | +- my $email = Email::MIME->create( |
363 | +- header_str => [ |
364 | +- From => $self->config->{organization}{email}, |
365 | +- To => $to, |
366 | +- Date => $self->get_timestamp_rfc2822, |
367 | +- Subject => 'DMARC too big report', |
368 | +- ], |
369 | +- parts => [@parts], |
370 | +- ) or croak "unable to assemble message\n"; |
371 | ++ my $email = MIME::Entity->build( |
372 | ++ Type => "multipart/mixed", |
373 | ++ From => $self->config->{organization}{email}, |
374 | ++ To => $to, |
375 | ++ Date => $self->get_timestamp_rfc2822, |
376 | ++ Subject => 'DMARC too big report' |
377 | ++ ) or croak "unable to create header!";; |
378 | ++ |
379 | ++ $email->attach( |
380 | ++ Type => "text/plain", |
381 | ++ Disposition => "inline", |
382 | ++ Charset => "US-ASCII", |
383 | ++ Data => $body, |
384 | ++ ) or croak "unable to add body and assemble message!"; |
385 | + |
386 | + return $email; |
387 | + } |
388 | +@@ -146,35 +142,27 @@ |
389 | + my $cf = 'gzip'; |
390 | + $filename .= $cf eq 'gzip' ? '.gz' : '.zip'; |
391 | + |
392 | +- my @parts = Email::MIME->create( |
393 | +- attributes => { |
394 | +- content_type => "text/plain", |
395 | +- disposition => "inline", |
396 | +- charset => "US-ASCII", |
397 | +- }, |
398 | +- body => $self->human_summary( $agg_ref ), |
399 | +- ) or croak "unable to add body!"; |
400 | +- |
401 | +- push @parts, |
402 | +- Email::MIME->create( |
403 | +- attributes => { |
404 | +- filename => $filename, |
405 | +- content_type => "application/$cf", |
406 | +- encoding => "base64", |
407 | +- name => $filename, |
408 | +- }, |
409 | +- body => $shrunk, |
410 | +- ) or croak "unable to add report!"; |
411 | +- |
412 | +- my $email = Email::MIME->create( |
413 | +- header_str => [ |
414 | +- From => $self->config->{organization}{email}, |
415 | +- To => $to, |
416 | +- Date => $self->get_timestamp_rfc2822, |
417 | +- Subject => $self->get_subject( $agg_ref ), |
418 | +- ], |
419 | +- parts => [@parts], |
420 | +- ) or croak "unable to assemble message\n"; |
421 | ++ my $email = MIME::Entity->build( |
422 | ++ Type => "multipart/mixed", |
423 | ++ From => $self->config->{organization}{email}, |
424 | ++ To => $to, |
425 | ++ Date => $self->get_timestamp_rfc2822, |
426 | ++ Subject => $self->get_subject( $agg_ref ) |
427 | ++ ) or croak "unable to create header!";; |
428 | ++ |
429 | ++ $email->attach( |
430 | ++ Type => "text/plain", |
431 | ++ Disposition => "inline", |
432 | ++ Charset => "US-ASCII", |
433 | ++ Data => \$self->human_summary( $agg_ref ), |
434 | ++ ) or croak "unable to add body to message!"; |
435 | ++ |
436 | ++ $email->attach( |
437 | ++ Type => "application/$cf", |
438 | ++ Encoding => "base64", |
439 | ++ Filename => $filename, |
440 | ++ Data => \$shrunk, |
441 | ++ ) or croak "unable to add report to message!"; |
442 | + |
443 | + return $email; |
444 | + } |
445 | diff --git a/debian/tests/control b/debian/tests/control |
446 | new file mode 100644 |
447 | index 0000000..04e9ccd |
448 | --- /dev/null |
449 | +++ b/debian/tests/control |
450 | @@ -0,0 +1,4 @@ |
451 | +Tests: splitting-check |
452 | +Depends: @, spamassassin, spamc, spamd |
453 | +Restrictions: needs-root |
454 | + |
455 | diff --git a/debian/tests/data/nice/noneok.eml b/debian/tests/data/nice/noneok.eml |
456 | new file mode 100644 |
457 | index 0000000..965a921 |
458 | --- /dev/null |
459 | +++ b/debian/tests/data/nice/noneok.eml |
460 | @@ -0,0 +1,23 @@ |
461 | +Return-Path: <test@dmarc1.spamassassin.org> |
462 | +Received: from dmarc1.spamassassin.org (dmarc1.spamassassin.org [64.142.3.173]) |
463 | + by dmarc1.spamassassin.org (8.14.9/8.14.9) with ESMTP id 13DFe22R006047 |
464 | + (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=NO); |
465 | + Tue, 13 Apr 2021 11:40:02 -0400 |
466 | +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d= |
467 | + dmarc1.spamassassin.org; h=from:to:subject:message-id:date |
468 | + :mime-version:content-type; s=selector1; bh=AaYQYg3XpWgPk5P7okfW |
469 | + fbeh0V4=; b=jxH2H2N0++4M6VJ/tebY0f+GOMteGMsjcHkP1S+oTE8657JmosdR |
470 | + S1VXtcJ5CwrXNTxe+9oW1bdU6QVL8fe7I1i2fXIEShaw6js+l5ymbvWts8o9kHZH |
471 | + Jv8+ZfwaSkmr6onD679oTxBFGOT0PkI33kQOoZnVQY9xF73vZXEA7NoWg0rmaGcT |
472 | + up8zinkgQV6BhdqJGzzi3je4QOdDgVmp1Pj42aaliurC0HlFZT/xAF0OZKVzwm3I |
473 | + J2dlpC84zKIlqa9vGnx16N1wIyA+/GnpJ13s4hg9N7PrAi7iotanBh0W+v/ujLnr |
474 | + MTjXJ11pMzp8xvoXtt3c+Ptxbf7TW4BxKA== |
475 | +From: SpamAssassin Test <test@dmarc1.spamassassin.org> |
476 | +To: undisclosed-recipients:; |
477 | +Subject: test message 1 |
478 | +Message-ID: <4A294538.10002@dmarc1.spamassassin.org> |
479 | +Date: Sun, 11 Apr 2021 02:00:04 +0000 |
480 | +MIME-Version: 1.0 |
481 | +Content-Type: text/plain; charset=us-ascii |
482 | + |
483 | +test message |
484 | diff --git a/debian/tests/data/nice/quarok.eml b/debian/tests/data/nice/quarok.eml |
485 | new file mode 100644 |
486 | index 0000000..7075137 |
487 | --- /dev/null |
488 | +++ b/debian/tests/data/nice/quarok.eml |
489 | @@ -0,0 +1,23 @@ |
490 | +Return-Path: <test@dmarc2.spamassassin.org> |
491 | +Received: from dmarc2.spamassassin.org (dmarc2.spamassassin.org [64.142.3.173]) |
492 | + by dmarc2.spamassassin.org (8.14.9/8.14.9) with ESMTP id 13DFe22R006047 |
493 | + (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=NO); |
494 | + Tue, 13 Apr 2021 11:40:02 -0400 |
495 | +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d= |
496 | + dmarc2.spamassassin.org; h=from:to:subject:message-id:date |
497 | + :mime-version:content-type; s=selector1; bh=AaYQYg3XpWgPk5P7okfW |
498 | + fbeh0V4=; b=2T58S24T2pMH5xPY2FB3YYH9qvdyXg6KZUIhNnj0bHFkmLbZWsYN |
499 | + lMdfQojRifSwD28tN8tljiKE9tdwNJeWj8sy6hGzvw5ksGjvAHjb46ZifWi9oD+7 |
500 | + 2ddAvVgKSV/wtVhg5dZCimNdDq3irKOQ881mPHuzdcXxEsNxYJUMR/989HTvdYLA |
501 | + eJAcT00hum1LdL+wdxZiG/JyC0G5mThARi/b3KdC7MV8DukO3pSRJjWsIgnEJNna |
502 | + +F7YCCJbp6Rm32HyUayYbov3ZMZ6MFzN9sYUkej/gUTl8LMacW3ibCcleeVD4oKN |
503 | + ksOe+bE0CAevco5lyqSEjSAXigBAGoV2ow== |
504 | +From: SpamAssassin Test <test@dmarc2.spamassassin.org> |
505 | +To: undisclosed-recipients:; |
506 | +Subject: test message 1 |
507 | +Message-ID: <4A294538.10002@dmarc2.spamassassin.org> |
508 | +Date: Sun, 11 Apr 2021 02:00:04 +0000 |
509 | +MIME-Version: 1.0 |
510 | +Content-Type: text/plain; charset=us-ascii |
511 | + |
512 | +test message |
513 | diff --git a/debian/tests/data/nice/rejectok.eml b/debian/tests/data/nice/rejectok.eml |
514 | new file mode 100644 |
515 | index 0000000..abf3603 |
516 | --- /dev/null |
517 | +++ b/debian/tests/data/nice/rejectok.eml |
518 | @@ -0,0 +1,23 @@ |
519 | +Return-Path: <test@dmarc3.spamassassin.org> |
520 | +Received: from dmarc3.spamassassin.org (dmarc3.spamassassin.org [64.142.3.173]) |
521 | + by dmarc3.spamassassin.org (8.14.9/8.14.9) with ESMTP id 13DFe22R006047 |
522 | + (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=NO); |
523 | + Tue, 13 Apr 2021 11:40:02 -0400 |
524 | +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d= |
525 | + dmarc3.spamassassin.org; h=from:to:subject:message-id:date |
526 | + :mime-version:content-type; s=selector1; bh=AaYQYg3XpWgPk5P7okfW |
527 | + fbeh0V4=; b=SfeRUmdB+35RaFj+etCrogC358LU4jiyF7Oa7Qsp+kp3rV++gfSG |
528 | + 6NKWuGAAbY+sA3M1m8KBXZXavPzmLRcZaorgVuHdmnsF+/5Fzmz6DBOSKhcM54p2 |
529 | + 1CfeiJAz0Rcudbxq9c3OJYlu1iSXDw1YwflRDgWv+Sed9T0jWmti1//N66NTZEKc |
530 | + 2O6EyI6KuBPUvRHRD04GBCAUweiM9HR4rVIDA9H7HFFPlVfB6Gm6iNhHy1tsuDSJ |
531 | + +1wMJcojXrdRje8QC6bIyQLsY7/H4X0tUbjXNHhC4d2oA0WQQ7mvVGWhtFQFDfIx |
532 | + G30/NRr8NICgPhjp91rAIXU9dKgdohdnWg== |
533 | +From: SpamAssassin Test <test@dmarc3.spamassassin.org> |
534 | +To: undisclosed-recipients:; |
535 | +Subject: test message 1 |
536 | +Message-ID: <4A294538.10002@dmarc3.spamassassin.org> |
537 | +Date: Sun, 11 Apr 2021 02:00:04 +0000 |
538 | +MIME-Version: 1.0 |
539 | +Content-Type: text/plain; charset=us-ascii |
540 | + |
541 | +test message |
542 | diff --git a/debian/tests/data/nice/strictrejectok.eml b/debian/tests/data/nice/strictrejectok.eml |
543 | new file mode 100644 |
544 | index 0000000..f1edb89 |
545 | --- /dev/null |
546 | +++ b/debian/tests/data/nice/strictrejectok.eml |
547 | @@ -0,0 +1,23 @@ |
548 | +Return-Path: <test@dmarc4.spamassassin.org> |
549 | +Received: from dmarc4.spamassassin.org (dmarc4.spamassassin.org [64.142.3.173]) |
550 | + by dmarc4.spamassassin.org (8.14.9/8.14.9) with ESMTP id 13DFe22R006047 |
551 | + (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=NO); |
552 | + Tue, 13 Apr 2021 11:40:02 -0400 |
553 | +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d= |
554 | + dmarc4.spamassassin.org; h=from:to:subject:message-id:date |
555 | + :mime-version:content-type; s=selector1; bh=AaYQYg3XpWgPk5P7okfW |
556 | + fbeh0V4=; b=0KPynqQB29CX6l5kp6+/x/HT7iTSC1G/u6yZJP0n/JpoqPVOvmbJ |
557 | + l3/U36gxCHPxz1D7dFWBgU2chDkAlTcz/+TkKF4jcta8pPsLTsbaJH6egS0krT+4 |
558 | + ydMeck2W98pj2zgh2yz25VqAP418y0EP/1QqlSDckjUayVRz3xakPVGX8fp4iIB4 |
559 | + lQ08239wyqHua0mJxjQuqi/Xr6qDxaPPJOs/U9+ToKrLlKuLw0LC2VGlzsttTt5z |
560 | + 8OBBIGfda0srAASmuwpyeilyFieaMAnpBuI1RAW0H5Ol8mqUjy8rjNKvoIPfZSUN |
561 | + hSDpuUAc9u58kcZZ0TSmodXazPYne4JlLw= |
562 | +From: SpamAssassin Test <test@dmarc4.spamassassin.org> |
563 | +To: undisclosed-recipients:; |
564 | +Subject: test message 1 |
565 | +Message-ID: <4A294538.10002@dmarc4.spamassassin.org> |
566 | +Date: Sun, 11 Apr 2021 02:00:04 +0000 |
567 | +MIME-Version: 1.0 |
568 | +Content-Type: text/plain; charset=us-ascii |
569 | + |
570 | +test message |
571 | diff --git a/debian/tests/data/spam/nodmarc.eml b/debian/tests/data/spam/nodmarc.eml |
572 | new file mode 100644 |
573 | index 0000000..0ad2e96 |
574 | --- /dev/null |
575 | +++ b/debian/tests/data/spam/nodmarc.eml |
576 | @@ -0,0 +1,22 @@ |
577 | +Return-Path: <newsalerts-noreply@dnsbltest.spamassassin.org> |
578 | +Received: from dnsbltest.spamassassin.org (dnsbltest.spamassassin.org [65.214.43.157]) by amgod.boxhost.net (Postfix) with SMTP id B9B2931016D for <jm-google-news-alerts@jmason.org>; Tue, 10 Feb 2004 18:18:49 +0000 (GMT) |
579 | +Received: by proxy.google.com with SMTP id so1951389 for <jm-google-news-alerts@jmason.org>; Tue, 10 Feb 2004 10:14:01 -0800 (PST) |
580 | +Received: by abbulk2 with SMTP id mr733125; Tue, 10 Feb 2004 10:14:01 -0800 (PST) |
581 | +Message-ID: <1076436841.67074.8fa05ccdc458abe5.1446041b@persist.google.com> |
582 | +Date: Tue, 10 Feb 2004 10:14:01 -0800 (PST) |
583 | +From: newsalerts-noreply@dnsbltest.spamassassin.org |
584 | +To: jm-google-news-alerts@jmason.org |
585 | +Subject: Google News Alert - spamassassin |
586 | +MIME-Version: 1.0 |
587 | +Content-Type: text/plain; charset="ISO-8859-1"; |
588 | + |
589 | +SWSOFT Unveils Plesk 7, Deployed by 1&1 |
590 | +Web Host Industry Review - USA |
591 | +... The software also features a newly designed Windows XP-like user interface, |
592 | +is equipped SpamAssassin, an open source anti-spam tool, and includes |
593 | +"Application ... |
594 | +<http://thewhir.com/marketwatch/sws021004.cfm> |
595 | +See all stories on this topic: |
596 | +<http://news.google.com/news?hl=en&lr=&ie=UTF-8&oe=utf8&client=google&num=30&newsc |
597 | +lusterurl=http://thewhir.com/marketwatch/sws021004.cfm> |
598 | + |
599 | diff --git a/debian/tests/data/spam/noneko.eml b/debian/tests/data/spam/noneko.eml |
600 | new file mode 100644 |
601 | index 0000000..09edf41 |
602 | --- /dev/null |
603 | +++ b/debian/tests/data/spam/noneko.eml |
604 | @@ -0,0 +1,21 @@ |
605 | +Return-Path: <test@dmarc1.spamassassin.org> |
606 | +Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) |
607 | + (using TLSv1.3 with cipher AEAD-AES128-GCM-SHA256 (128/128 bits)) |
608 | + (No client certificate requested) |
609 | + by dmarc1.spamassassin.org (Postfix) with ESMTPS id EDD4E2073D |
610 | + for <test@dmarc1.spamassassin.org>; Tue, 15 Jun 2021 11:55:45 +0200 (CEST) |
611 | +Received: from PC ([2409:4063:231e:c527:1997:664a:34e5:7d88]) |
612 | + by smtp.gmail.com with ESMTPSA id n23sm15339981pgv.76.2021.06.15.02.55.37 |
613 | + for <test@dmarc1.spamassassin.org> |
614 | + (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); |
615 | + Tue, 15 Jun 2021 02:55:43 -0700 (PDT) |
616 | +Message-ID: <1076436841.67074.8fa05ccdc458abe5.1446041b@persist.google.com> |
617 | +From: SpamAssassin Test <test@dmarc1.spamassassin.org> |
618 | +To: undisclosed-recipients:; |
619 | +Subject: test message 1 |
620 | +Message-ID: <4A294538.10002@dmarc1.spamassassin.org> |
621 | +Date: Mon, 08 Jun 2009 12:00:00 +0000 |
622 | +MIME-Version: 1.0 |
623 | +Content-Type: text/plain; charset=us-ascii |
624 | + |
625 | +testing |
626 | diff --git a/debian/tests/data/spam/quarko.eml b/debian/tests/data/spam/quarko.eml |
627 | new file mode 100644 |
628 | index 0000000..5fc5351 |
629 | --- /dev/null |
630 | +++ b/debian/tests/data/spam/quarko.eml |
631 | @@ -0,0 +1,21 @@ |
632 | +Return-Path: <test@dmarc2.spamassassin.org> |
633 | +Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) |
634 | + (using TLSv1.3 with cipher AEAD-AES128-GCM-SHA256 (128/128 bits)) |
635 | + (No client certificate requested) |
636 | + by dmarc2.spamassassin.org (Postfix) with ESMTPS id EDD4E2073D |
637 | + for <test@dmarc2.spamassassin.org>; Tue, 15 Jun 2021 11:55:45 +0200 (CEST) |
638 | +Received: from PC ([2409:4063:231e:c527:1997:664a:34e5:7d88]) |
639 | + by smtp.gmail.com with ESMTPSA id n23sm15339981pgv.76.2021.06.15.02.55.37 |
640 | + for <test@dmarc2.spamassassin.org> |
641 | + (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); |
642 | + Tue, 15 Jun 2021 02:55:43 -0700 (PDT) |
643 | +Message-ID: <1076436841.67074.8fa05ccdc458abe5.1446041b@persist.google.com> |
644 | +From: SpamAssassin Test <test@dmarc2.spamassassin.org> |
645 | +To: undisclosed-recipients:; |
646 | +Subject: test message 1 |
647 | +Message-ID: <4A294538.10002@dmarc2.spamassassin.org> |
648 | +Date: Mon, 08 Jun 2009 12:00:00 +0000 |
649 | +MIME-Version: 1.0 |
650 | +Content-Type: text/plain; charset=us-ascii |
651 | + |
652 | +testing |
653 | diff --git a/debian/tests/data/spam/rejectko.eml b/debian/tests/data/spam/rejectko.eml |
654 | new file mode 100644 |
655 | index 0000000..b3c0009 |
656 | --- /dev/null |
657 | +++ b/debian/tests/data/spam/rejectko.eml |
658 | @@ -0,0 +1,21 @@ |
659 | +Return-Path: <test@dmarc3.spamassassin.org> |
660 | +Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) |
661 | + (using TLSv1.3 with cipher AEAD-AES128-GCM-SHA256 (128/128 bits)) |
662 | + (No client certificate requested) |
663 | + by dmarc3.spamassassin.org (Postfix) with ESMTPS id EDD4E2073D |
664 | + for <test@dmarc3.spamassassin.org>; Tue, 15 Jun 2021 11:55:45 +0200 (CEST) |
665 | +Received: from PC ([2409:4063:231e:c527:1997:664a:34e5:7d88]) |
666 | + by smtp.gmail.com with ESMTPSA id n23sm15339981pgv.76.2021.06.15.02.55.37 |
667 | + for <test@dmarc3.spamassassin.org> |
668 | + (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); |
669 | + Tue, 15 Jun 2021 02:55:43 -0700 (PDT) |
670 | +Message-ID: <1076436841.67074.8fa05ccdc458abe5.1446041b@persist.google.com> |
671 | +From: SpamAssassin Test <test@dmarc3.spamassassin.org> |
672 | +To: undisclosed-recipients:; |
673 | +Subject: test message 1 |
674 | +Message-ID: <4A294538.10002@dmarc3.spamassassin.org> |
675 | +Date: Mon, 08 Jun 2009 12:00:00 +0000 |
676 | +MIME-Version: 1.0 |
677 | +Content-Type: text/plain; charset=us-ascii |
678 | + |
679 | +testing |
680 | diff --git a/debian/tests/data/spam/strictrejectko.eml b/debian/tests/data/spam/strictrejectko.eml |
681 | new file mode 100644 |
682 | index 0000000..edbec9a |
683 | --- /dev/null |
684 | +++ b/debian/tests/data/spam/strictrejectko.eml |
685 | @@ -0,0 +1,23 @@ |
686 | +Return-Path: <test@dmarc4.spamassassin.org> |
687 | +Received: from dmarc4.spamassassin.org (dmarc4.spamassassin.org [1.2.3.4]) |
688 | + by dmarc4.spamassassin.org (8.14.9/8.14.9) with ESMTP id 13DFe22R006047 |
689 | + (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=NO); |
690 | + Tue, 13 Apr 2021 11:40:02 -0400 |
691 | +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d= |
692 | + dmarc4.spamassassin.org; h=from:to:subject:message-id:date |
693 | + :mime-version:content-type; s=dkim; bh=vxHXq7bMZ9+UHGuKBsbQKsDHm |
694 | + mk=; b=Gm/CB7JaShGbluYAiHOBX0CcOvye9210Tghzmuvya0j0EF7dfJH8I9+wc |
695 | + zFxo4JdBQ6xoq6zXwOLU8pVcpDtxrOzIPkidkVsI1iDi7tApONTuG9JW/vVNId/J |
696 | + RBsp8Z2gi5vO07L2dtcZEIVOXM1MKN/69gXiGY3TbyhO63iFno04nAQFHooQYdqk |
697 | + a6C8s0n3AVfPEE4cbTit67kREHVm+ZMQpd281BUh9zOftfL+R7VEWWSnSz5EmeBU |
698 | + MihnFhg5DpEAIFyJ9ZqspI4CG0gAiRzd+Ol2ciJOAhm/hcqn3/J0YPqtN/1Cl7I2 |
699 | + jrtCRUnSpndamKLJp1aLWibYYkbwQ== |
700 | +From: SpamAssassin Test <test@dmarc4.spamassassin.org> |
701 | +To: undisclosed-recipients:; |
702 | +Subject: test message 1 |
703 | +Message-ID: <4A294538.10002@dmarc4.spamassassin.org> |
704 | +Date: Sun, 11 Apr 2021 02:00:04 +0000 |
705 | +MIME-Version: 1.0 |
706 | +Content-Type: text/plain; charset=us-ascii |
707 | + |
708 | +test message |
709 | diff --git a/debian/tests/splitting-check b/debian/tests/splitting-check |
710 | new file mode 100644 |
711 | index 0000000..8b7ecf0 |
712 | --- /dev/null |
713 | +++ b/debian/tests/splitting-check |
714 | @@ -0,0 +1,44 @@ |
715 | +#!/bin/bash |
716 | + |
717 | +# The data we use for this test come from spamassassin's test suite (build tests): |
718 | +# |
719 | +# - d/t/data/nice contains messages that qualifies as PASS due to the DMARC rules (DMARC_PASS). |
720 | +# - d/t/data/spam contains messages that are market as REJECT, QUARENTINE, MISSING or NONE: |
721 | +# |
722 | +# root@Mspamassasin-suggested:~# l spam_mails/ |
723 | +# nodmarc.eml noneko.eml quarko.eml rejectko.eml strictrejectko.eml |
724 | +# root@Mspamassasin-suggested:~# spamc -R < spam_mails/rejectko.eml | grep DMARC |
725 | +# 1.8 DMARC_REJECT DMARC reject policy |
726 | +# root@Mspamassasin-suggested:~# spamc -R < spam_mails/strictrejectko.eml | grep DMARC |
727 | +# 1.8 DMARC_REJECT DMARC reject policy |
728 | +# root@Mspamassasin-suggested:~# spamc -R < spam_mails/quarko.eml | grep DMARC |
729 | +# 1.2 DMARC_QUAR DMARC quarantine policy |
730 | +# root@Mspamassasin-suggested:~# spamc -R < spam_mails/nodmarc.eml | grep DMARC |
731 | +# 0.0 DMARC_MISSING Missing DMARC policy |
732 | +# root@Mspamassasin-suggested:~# spamc -R < spam_mails/noneko.eml | grep DMARC |
733 | +# 0.9 DMARC_NONE DMARC none policy |
734 | + |
735 | +set -eo pipefail |
736 | + |
737 | +check_dmarc_policy_reporting(){ |
738 | + local eml="${1}" |
739 | + local policy="${2}" |
740 | + |
741 | + spamc -R < "${eml}" | grep -qF DMARC_"${policy}" |
742 | + |
743 | +} |
744 | + |
745 | +for m in $(find debian/tests/data/nice/ -type f); do |
746 | + check_dmarc_policy_reporting "${m}" "PASS" |
747 | +done |
748 | + |
749 | +declare -A EXPECTED_RESULT |
750 | +EXPECTED_RESULT["nodmarc.eml"]="MISSING" |
751 | +EXPECTED_RESULT["noneko.eml"]="NONE" |
752 | +EXPECTED_RESULT["quarko.eml"]="QUAR" |
753 | +EXPECTED_RESULT["rejectko.eml"]="REJECT" |
754 | +EXPECTED_RESULT["strictrejectko.eml"]="REJECT" |
755 | + |
756 | +for m in ${!EXPECTED_RESULT[@]}; do |
757 | + check_dmarc_policy_reporting "debian/tests/data/spam/${m}" "${EXPECTED_RESULT[${m}]}" |
758 | +done |
759 | \ No newline at end of file |
A few whitespace nits. Not necessary to fix if you're in a hurry to upload.
For the changelog it would be nice to see a statement in the first line or two what the goal of this set of changes is. I.e. "Readjust dependencies to allow inclusion in main, so that spamassassin can start depending on DMARC for stronger spam filtering." This is also not necessary to fix if you're in a hurry to upload, since the various bug references will lead one to LP: #2061865 which has a good explanation.
You might want to squash some of the commits together, but you mentioned already about cleanup so perhaps you plan this already?