]> git.donarmstrong.com Git - debbugs.git/commitdiff
remove getmailbody from errorlib
authorDon Armstrong <don@donarmstrong.com>
Tue, 18 Sep 2007 07:30:02 +0000 (00:30 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 18 Sep 2007 07:30:02 +0000 (00:30 -0700)
scripts/errorlib.in

index 85bc9ba66f9349573a0561aa8053dcc5602541df..a2e90161730a1454cb03134fca9efb458102cec2 100755 (executable)
@@ -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() }