Your message dated Sat, 07 Nov 2020 23:18:38 +0000 with message-id <[email protected]> and subject line Bug#944887: fixed in libemail-mime-perl 1.949-1 has caused the Debian Bug report #944887, regarding libemail-mime-perl: fails to handle boundary="0" to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 944887: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944887 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: libemail-mime-perl Version: 1.946-1 Severity: normal Tags: upstream patch Email::MIME fails to handle mail with a boundary value of "0", since Perl treats 0 as false. This is a common type of bug in Perl code. Reading RFC 2046, the BNF for allowed boundary characters allows 1-70 characters, so a single "0" is acceptable: boundary := 0*69<bchars> bcharsnospace bchars := bcharsnospace / " " bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-" / "." / "/" / ":" / "=" / "?">From 72e288ff88a191976be339929bed1d2c9c6d1b7a Mon Sep 17 00:00:00 2001 From: Eric Wong <[email protected]> Date: Sun, 17 Nov 2019 08:57:49 +0000 Subject: [PATCH] Email::MIME: allow "0" as boundary value Reading RFC 2046, the BNF for allowed boundary characters allows 1-70 characters, so a single "0" is acceptable: boundary := 0*69<bchars> bcharsnospace bchars := bcharsnospace / " " bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-" / "." / "/" / ":" / "=" / "?" --- lib/Email/MIME.pm | 6 ++++-- t/multipart.t | 13 ++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/Email/MIME.pm b/lib/Email/MIME.pm index 0997da4..b7c6e64 100644 --- a/lib/Email/MIME.pm +++ b/lib/Email/MIME.pm @@ -387,7 +387,9 @@ sub parts_multipart { # that means it's a bogus message, but a mangled result (or exception) is # better than endless recursion. -- rjbs, 2008-01-07 return $self->parts_single_part - unless $boundary and $self->body_raw =~ /^--\Q$boundary\E\s*$/sm; + unless defined($boundary) and + $boundary ne '' and + $self->body_raw =~ /^--\Q$boundary\E\s*$/sm; $self->{body_raw} = $self->SUPER::body; @@ -541,7 +543,7 @@ sub boundary_set { my ($self, $value) = @_; my $ct_header = parse_content_type($self->header('Content-Type')); - if ($value) { + if (defined($value) && $value ne '') { $ct_header->{attributes}->{boundary} = $value; } else { delete $ct_header->{attributes}->{boundary}; diff --git a/t/multipart.t b/t/multipart.t index 6d44836..12e5eca 100644 --- a/t/multipart.t +++ b/t/multipart.t @@ -67,15 +67,15 @@ is $parts[2]->body_str, 'Hello'; { my $email = Email::MIME->new(<<'END'); Subject: hello -Content-Type: multipart/mixed; boundary="bananas" +Content-Type: multipart/mixed; boundary="0" Prelude ---bananas +--0 Content-Type: text/plain This is plain text. ---bananas-- +--0-- Postlude END @@ -83,6 +83,13 @@ END like($email->as_string, qr/Prelude/, "prelude in string"); like($email->as_string, qr/Postlude/, "postlude in string"); + my @p; + $email->walk_parts(sub { + my $str = eval { $_[0]->body_str }; + push(@p, $str) if defined($str); + }); + is_deeply(\@p, ['This is plain text.']); + $email->parts_set([ $email->subparts ]); unlike($email->as_string, qr/Prelude/, "prelude in string");
--- End Message ---
--- Begin Message ---Source: libemail-mime-perl Source-Version: 1.949-1 Done: Joenio Marques da Costa <[email protected]> We believe that the bug you reported is fixed in the latest version of libemail-mime-perl, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Joenio Marques da Costa <[email protected]> (supplier of updated libemail-mime-perl package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Format: 1.8 Date: Sat, 07 Nov 2020 18:28:50 +0100 Source: libemail-mime-perl Architecture: source Version: 1.949-1 Distribution: unstable Urgency: medium Maintainer: Debian Perl Group <[email protected]> Changed-By: Joenio Marques da Costa <[email protected]> Closes: 944887 Changes: libemail-mime-perl (1.949-1) unstable; urgency=medium . * Team upload . [ Damyan Ivanov ] * declare conformance with Policy 4.1.3 (no changes needed) . [ Salvatore Bonaccorso ] * Update Vcs-* headers for switch to salsa.debian.org . [ gregor herrmann ] * debian/copyright: replace tabs with spaces / remove trailing whitespace. * debian/watch: use uscan version 4. . [ Debian Janitor ] * Bump debhelper from old 9 to 12. * Set debhelper-compat version in Build-Depends. * Set upstream metadata fields: Bug-Submit. * Remove obsolete fields Contact, Name from debian/upstream/metadata (already present in machine-readable debian/copyright). . [ Salvatore Bonaccorso ] * Allow "0" as boundary value (Closes: #944887) . [ Joenio Marques da Costa ] * Import upstream version 1.949 * Set Rules-Requires-Root: no * d/control: depends on libemail-mime-contenttype-perl => 1.023 * d/control: remove version from libemail-mime-encodings-perl * Allow-0-as-boundary-value patch accepted on upstream * declare compliance with Debian Policy 4.5.0 * update debhelper compat to 13 * Add myself to d/copyright . [ gregor herrmann ] * Annotate test-only build dependencies with <!nocheck>. Checksums-Sha1: 82a76645c09589d05681b65907cb0944a25edc43 2761 libemail-mime-perl_1.949-1.dsc 605b40bea05361b2b3ce4888876ce3a338b6102a 126937 libemail-mime-perl_1.949.orig.tar.gz a36a255f57a4e0c8fbdbea2720451d8332fe6829 4864 libemail-mime-perl_1.949-1.debian.tar.xz Checksums-Sha256: e05d2aa2880ac6d1cb4a7b68939dc3cdda11a7b5df6ecacf5353fd6504606e21 2761 libemail-mime-perl_1.949-1.dsc 3b0adf6bb413cfe51d75f8ba79aca80deafc98dc1179aa7b2d7a79aff5a6ab9c 126937 libemail-mime-perl_1.949.orig.tar.gz c3558d0338b650bca5fb873c0eaf930acc51e185f46de0d5f9a1b5568679814a 4864 libemail-mime-perl_1.949-1.debian.tar.xz Files: cd2166ee3641b800097d553a3e754235 2761 perl optional libemail-mime-perl_1.949-1.dsc 7dd94b8144ecf8078ad1c3eca5658fbf 126937 perl optional libemail-mime-perl_1.949.orig.tar.gz e95e5d6578acabf56d0fb44560cab101 4864 perl optional libemail-mime-perl_1.949-1.debian.tar.xz -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE0eExbpOnYKgQTYX6uzpoAYZJqgYFAl+nJqZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEQx RTEzMTZFOTNBNzYwQTgxMDREODVGQUJCM0E2ODAxODY0OUFBMDYACgkQuzpoAYZJ qgYZNBAAg7/nQ2Yg31Kre9rOWmxEAn3Hohei5OCTpeUi4S2SCaiM0R66KP74fMAJ tRuUH1yibx2t0Y8nSFsvRB9nIGC+G91ldGDT2mxtjOD7FjDJJxwhdXOrErIfw4J3 tcffnqZtHqCstIWhKPCpb0EuXTUqU7GmEvLW3wI9JImvAtyPxyKg69uahN5WxKr2 /q0yq/WVXb/p7tEsOzsQk9SYiFWibJ+zoF0OW/apSRuBj6nTZfFmWfgLFqs/MG3n N9IsLaj2+QS9ogGSKNCc7RhYq3fQUGXqa8JQ1GsWXmTbT06yDzN83sitxNSWhcEJ WYRJB1K9Lx862OOiWCileMhfN1WM/PFrBc80SPGUy5TLT9sWjcDFaLLffBdhUYu1 08GftUAsqVyIoyfyQp7bgjJll30xXVVHKfJ5URSQq0+8vNu5RmflLSNFMwnjsxLF h1Wotknh9vFfF/oXJNvKpW/ncJryaFa/dRj4kzePic4BdTz+mwCF9Za15vWqFEPT FVyhhYCLa/hx35CWtw44bpT1OKN3762Ukgn5vjdDvCPmUzJEMXOi9kewzxCM+sZi nbS7rXJAengwu6YfT3gtTj7lv/kegwGr7gJGDsY1Q9DClPuzzbUldShPkbO1mf4r YZzt1DFuXB9A3Gd54veA24/ntxMIcEDLyXcn6LYST5pYwy6K4wc= =V3bW -----END PGP SIGNATURE-----
--- End Message ---

