Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
So I can search via subject, or just retrieve all. But here's where I'm stuck. I need for it to search for 3 different subject lines, and I need to search only X minutes in the past, 30 in this case. If a combined 20 or more matches of the 3 subject lines are found, it fires an alert, otherwise it just loops. I don't understand enough about hashes and keys and map to figure out how to loop through these messages looking for my subject lines. I know I can figure out the go back X minutes from the docs, but the real meat I"m unsure of - any ideas?for my $h ( # values %{$imap->parse_headers( scalar($imap->search("ALL")) +, "Subject", "Date")} values %{$imap->parse_headers( scalar($imap->search("SUBJECT" +,"A time out or a transaction deadlockDDD")) , "Subject", "Date")} ) { print map { "$_:\t$h->{$_}[0]\n"} keys %$h; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Mail::IMAPClient
by crashtest (Curate) on Nov 08, 2005 at 02:57 UTC | |
by jpavleck (Initiate) on Nov 08, 2005 at 22:27 UTC |