Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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.

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://21863]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2018-05-22 09:21 GMT
Find Nodes?
    Voting Booth?