[Mimedefang] Message Mime Data - Relays

Jonas Eckerman jonas_lists at frukt.org
Wed May 23 18:27:44 EDT 2007


Daniel Aquino wrote:

> Can I extract Mime Data from an email ?

Did you the documentation for mimedefang-filter? Info about this
is found at the very top of the mimedefang-filter man page.

In short: MIMEDefang does this, and passes the results to the
"filter_begin", "filter", "filter_multipart" and "filter_end"
callbacks as MIME::Entity objects.

To see how to access data in those entities, read the
documentation with perldoc or on CPAN.

> Particularly the mail_relays which were used ?

You don't need to care about MIME for that.

The information about relays the mail has passed are in the
Received headers. You can get to those headers in your filter
through the entities passed to "filter_begin" and "filter_end" or
by reading the file "./HEADERS".

If you don't wish to do your own code for parsing those headers,
you can use Mail::Field::Received.

A search for "Received" in my filter at
http://whatever.frukt.org/mimedefangfilter.text.shtml shows one
example of how to do this.

Do note that in case of spam and other bad stuff, one or more
Received headers are often faked.

Regards
/Jonas
-- 
Jonas Eckerman, FSDB & Fruktträdet
http://whatever.frukt.org/
http://www.fsdb.org/
http://www.frukt.org/




More information about the MIMEDefang mailing list