Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Searching the body of a received email.

by Pearte (Beadle)
on Jul 11, 2000 at 00:07 UTC ( [id://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.

Replies are listed 'Best First'.
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
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found