Oct 202012
 

I think I have a solution for base64 emails. I emailed Matthew Seaman on Wednesday about this issue. He put me onto two very useful Perl modules:

The solution is coded below:

sub myGetMessage {
    my ($message);
    my ($encoding);

    while (<>) {
        $message .= $_;
    }

    $encoding = myGetMessage_ContentTransferEncoding($message);
    print $encoding;

    if ($encoding eq 'base64')
    {
        # we need to extract the body from this message, base64 decode it, and go from there...
        my $parsed = Email::MIME->new($message);
        my $content_type = $parsed->content_type;

        $parsed->body_set($parsed->body);

        my $header = $parsed->header_obj;
        $message = $header->as_string . $parsed->body_str;

    }

    return $message;
}

I have yet to use this against any real commits, but it works just fine against the test message I have here.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

  One Response to “Solution found for base64 emails”

  1. Guess what… now I can’t recall what server I made this change on…