[Mimedefang] Eml Attachments

Nathan Findley nathan at zenlok.com
Fri Nov 18 01:15:17 EST 2011


Hi all,

How would I save an eml attachment on an incoming mail?  Does this look
reasonable on a basic level?

sub filter_multipart ($$$$) {
    my($entity, $fname, $ext, $type) = @_;

    open FH, ">/tmp/copy.eml" or die $!;
    if (re_match($entity, '\.eml') and ($type eq "message/rfc822")) {
      $entity->print_body(FH);
    }
    close FH;
}


Thanks,
Nate




More information about the MIMEDefang mailing list