[Mimedefang] How to Get Header info from $entity Object Passed to filter_end Routine

George Kuetemeyer George.Kuetemeyer at mail.tju.edu
Wed Apr 30 20:13:01 EDT 2003


I'm writing a routine to be called from within the filter_end routine. I'm
passing the $entity variable from filter_end to my routine. I'm assuming that
$entity is an object of class MIME::Entity that refers to the entire message??
If so, I should be able to get a header object via:

    my $head = $entity->head;

And then get specific top level header info via:

    my $from = $head->get('From);
    my $to   = $head->get('To');

And then write out the entire message to a file:

    open OUT,">>$out";
    $entity->print(\*OUT);

And so on. Unfortunately, this doesn't appear to work. Am I missing something?
Is there some other way to do this? I need from/to info and the ability to
copy entire messages to a special directory.

Thanks in advance.





More information about the MIMEDefang mailing list