You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2004/09/05 00:33:19 UTC

[Bug 3750] decode_attachments not used

http://bugzilla.spamassassin.org/show_bug.cgi?id=3750





------- Additional Comments From felicity@kluge.net  2004-09-04 15:33 -------
Subject: Re:  New: decode_attachments not used

On Sat, Sep 04, 2004 at 02:31:10PM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> 3.0.0-rc3 includes the "decode_attachments" property, but then does nothing with
> it. If you could make this property cause the decoding of all attachments, and
> not just text ones, it would be great.

I'm missing something.  If you added in the property (grep returns no hits for
"decode_attachments" in 2.6x and 3.x code), then we're not going to be able to
change the behavior of the code that was added.

> I can't work out in 3 where to add my own patch for decoding all attachments. A
> pointer where to patch this would suffice, but an integrated solution would be best.

You don't need to patch 3.0 for that. :)

The internal representation of the message is a tree with all the MIME
parts in different nodes.  If you want to go through and get the decoded
versions of all the parts that are leaf nodes (aka: not multipart/*,
subparsed message/*, etc), you could use find_parts() to return the
nodes you're interested in, and then call decode() on each part.  Ala:

my $sa = new Mail::SpamAssassin(...);
my $msg = $sa->parse($msg, 1);
foreach my $p ($msg->find_parts(qr/./, 1)) {
  my $decoded_part = $p->decode();
  ...
}

$decoded_part is a scalar which has the decoded part in it.  The
Mail::SpamAssassin::Message and Mail::SpamAssassin::Message::Node POD has more
information about this stuff.

It's sounding more like you have questions related to updating MailScanner to
work with the 3.0 API, rather than this being a bug or enhancement request.
If so, we can close this ticket as WFM and take the discussion to the
dev@spamassassin.apache.org list.





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.