access to binary attachments from $PerMsgStatus ? - SpamAssassin

This is a discussion on access to binary attachments from $PerMsgStatus ? - SpamAssassin ; 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. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: access to binary attachments from $PerMsgStatus ?

  1. 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)


    sub zipcontent_is_like {
    my ($self, $permsgstatus, $args, @Args) = @_;

    my $msg = $permsgstatus->get_message();

    for my $i (@{$msg->{body_parts}}) {
    print Data:umper->Dump([ $i ]);
    }

    ...


    So: what can I do to get access to the binary / base64 attachment content?

    TIA, Chris

    --
    Christian Recktenwald
    spamassassin-talk-dist@citecs.de


  2. Re: access to binary attachments from $PerMsgStatus ?

    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/


+ Reply to Thread