Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Searching the body of a received email.

by Pearte (Beadle)
on Jul 11, 2000 at 00:07 UTC ( #21863=perlquestion: print w/ replies, xml ) Need Help??
Pearte has asked for the wisdom of the Perl Monks concerning the following question:

Monks, Problem: Suppose I am submitting a number of queries to a machine. As those queries are processed, that machine sends me emails as to the success or failure of my requests. Each reply is from an identical sender and each subject field is the same as well. The one distinguishing feature is the filename in the body of the message. Question: Is there a way to search the body of the message for the filename and success lines? -Pearte

Comment on Searching the body of a received email.
Re: Searching the body of a received email.
by btrott (Parson) on Jul 11, 2000 at 00:11 UTC
    Search in what sense? How are you receiving the messages? Do you have a process (like procmail) that filters your incoming messages?

    You might want to check out Using Perl to Read Mail, which describes how to load your mailbox into Perl easily.

    You might also check out My Life with Spam, in which Mark-Jason Dominus presents some good examples of filtering mail.

RE: Searching the body of a received email.
by Russ (Deacon) on Jul 11, 2000 at 00:37 UTC
    Mail::Internet could help you.

    Looks like you would use it like:

    open MAIL, 'MyMailFile' or die "Couldn't open mail file: $!"; my $Mail = Mail::Internet->new(MAIL); my $Body = $Mail->body(); print if /matching filename/ for @$Body;
    Russ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://21863]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-10-21 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (95 votes), past polls