From: Don Armstrong Date: Tue, 18 Sep 2007 07:30:02 +0000 (-0700) Subject: remove getmailbody from errorlib X-Git-Tag: release/2.6.0~510^2~23 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b98a16aec63d8773697b81ca0f699e65bb7076e8;p=debbugs.git remove getmailbody from errorlib --- diff --git a/scripts/errorlib.in b/scripts/errorlib.in index 85bc9ba6..a2e90161 100755 --- a/scripts/errorlib.in +++ b/scripts/errorlib.in @@ -1,7 +1,7 @@ # -*- perl -*- use Mail::Address; -use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522); +use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522 getmailbody); use Debbugs::Packages qw(:all); use Debbugs::Common qw(:all); use Debbugs::Status qw(:all); @@ -22,29 +22,6 @@ sub sani { return $in; } -sub getmailbody { - my $entity = shift; - my $type = $entity->effective_type; - if ($type =~ m#text/(?!html|enriched)# or - $type eq 'application/pgp') { - return $entity->bodyhandle; - } elsif ($type eq 'multipart/alternative') { - # RFC 2046 says we should use the last part we recognize. - for my $part (reverse $entity->parts) { - my $ret = getmailbody($part); - return $ret if $ret; - } - } else { - # For other multipart types, we just pretend they're - # multipart/mixed and run through in order. - for my $part ($entity->parts) { - my $ret = getmailbody($part); - return $ret if $ret; - } - } - return undef; -} - sub get_addresses { return map { $_->address() }