CentOS 5.x | SendMail
Is there an easy way to retrieve individual messages from /var/spool/mail/? I have an idea for a really simple script and would like to check each individual message for something.
The scenario would be:
1) new email arrives in inbox. 2) Script checks for certain string. 3) If string is found, script retrieves various header info and emails info to address.
I realize that a milter would probably be the way to go but I was hoping to find a way to do this with a shell script as I want to practice that. The problem is that I can't seem to find a way to parse or otherwise isolate the individual messages. When I examine /var/spool/mail/, I see a big file with multiple messages and no unique delimiter between messages.