You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Christian Recktenwald <sp...@citecs.de> on 2008/09/13 17:15:45 UTC
access to binary attachments from $PerMsgStatus ?
Hi,
writing a plugin to investigate zip-file content I see the need
to get access to attachment data.
The stucture I get from the method argv using the code below
lacks contents using the MIME type "application/octet-stream" - at least.
(If I just change the content-type: header for testing purpose to
"text/plain" in the message, I can get the binary stuff)
<noxmltag type="read_this_as_code">
sub zipcontent_is_like {
my ($self, $permsgstatus, $args, @Args) = @_;
my $msg = $permsgstatus->get_message();
for my $i (@{$msg->{body_parts}}) {
print Data::Dumper->Dump([ $i ]);
}
...
</noxmltag>
So: what can I do to get access to the binary / base64 attachment content?
TIA, Chris
--
Christian Recktenwald
spamassassin-talk-dist@citecs.de
Re: access to binary attachments from $PerMsgStatus ?
Posted by Jonas Eckerman <jo...@frukt.org>.
Christian Recktenwald wrote:
> The stucture I get from the method argv using the code below
> lacks contents using the MIME type "application/octet-stream" - at least.
[...]
> for my $i (@{$msg->{body_parts}}) {
Have you tried using the find_parts method?
see perldoc Mail::SpamAssassin::Message::Node
Regards
/Jonas
--
Jonas Eckerman, FSDB & Fruktträdet
http://whatever.frukt.org/
http://www.fsdb.org/
http://www.frukt.org/