my $entity = shift;
my $type = $entity->effective_type;
if ($type eq 'text/plain' or
- ($type =~ m#text/# and $type ne 'text/html') or
+ ($type =~ m#text/?# and $type ne 'text/html') or
$type eq 'application/pgp') {
return $entity->bodyhandle;
} elsif ($type eq 'multipart/alternative') {
# Strip off RFC2440-style PGP clearsigning.
if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
- shift @bodylines while @bodylines and length $bodylines[0];
+ shift @bodylines while @bodylines and
+ length $bodylines[0] and
+ # we currently don't strip \r; handle this for the
+ # time being, though eventually it should be stripped
+ # too, I think. [See #565981]
+ $bodylines[0] ne "\r";
shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
for my $findsig (0 .. $#bodylines) {
if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {
* Ditch \r and \n in status fields (closes: #545895)
* Properly handle source packages when searching by maintainer; use
package_maintainer instead of the hashes (closes: #556863)
+ * Handle \r properly in Debbugs::MIME for PGP signatures
+ (closes: #565981). Thanks to Mike Hommey
+ * Allow type to be text as well as text/(something not html)
+ (closes: #566068). Thanks to Mike Hommey.
-- Don Armstrong <don@debian.org> Wed, 26 Aug 2009 21:32:53 -0700