Mail::Audit and MIME content

S

ssidct

I see accept,reject,pipe,ignore as methods for Mail::Audit It also says
each one of these methods is final, in the sense that execution stops
at that point unless you turn on the flag for "noexit". Somewhere in
the documentation it mentions that MIME messages are parsed by default.
I am most interested in this part but don't see examples of how to do
it. Once a mail mesage is saved in a spool directory I can use
MIME::parser to extract the files from it. But how do I do it using
Mail::Audit methods. I want to be able to grab the mail as it comes in
(using the .forward file) extract the MIME content and then do
something with the extracted content all in one script. Is this doable?

thanks
SS
 
P

Peter J. Holzer

Somewhere in the documentation it mentions that MIME messages are
parsed by default. I am most interested in this part but don't see
examples of how to do it. Once a mail mesage is saved in a spool
directory I can use MIME::parser to extract the files from it. But how
do I do it using Mail::Audit methods.

perldoc Mail::Audit says:

| "Mail::Audit" groks MIME; when appropriate, it subclasses
| "MIME::Entity".

So the answer is: Exactly the same as with MIME::Entity methods.

hp
 
S

ssidct

But I thought MIME::Entity is for composing mail with mime content -
how does one parse an incoming mail with it and do something with
parsed mime content. Can someone give me examles?
thanks
 
P

Peter J. Holzer

But I thought MIME::Entity is for composing mail with mime content -

No. A MIME::Entity represents a MIME message or any of its parts (if it
is a multipart message). You can compose a message by constructing a
MIME::Entity and convert it to a string, or you can parse a string to a
MIME::Entity and then access its parts.
how does one parse an incoming mail with it

You don't. Mail::Audit already does that for you. The result of
Mail::Audit->new *is* a parsed message (i.e. a MIME::Entity object).
and do something with
parsed mime content. Can someone give me examles?

Please read the docs for MIME::Tools as the documentation of Mail::Audit
suggests.
Also read the docs for MIME::Entity, MIME::Head and MIME::Body. They
contain plenty of examples. If you have read them, and have a specific
problem, post your code here together with a description of what it
should do and what it really does, and I will be glad to help.

hp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top