I am using fetchmail in combination with procmail for mail filtering on CentOS where my mail contains various log messages. They serve me so I could search through my mail(logs) for error strings. So does anyone haves an idea how could I check if one mail is missing because I have a fixed number of mail sent to me every day, and if a server crashes obviously it won't send the mail, how can I determine if a mail is missing and if it is to send an alert through email?
When I get my mail with fetchmail and process it with procmail I need to look through
procmail.log file so I could determine if a certain mail hasn't arrived. My log file looks like this:
From email@example.com Wed Dec 31 10:38:49 2014 Subject: example1 -> Incremental 1 -> DEV backup Folder: /dev/null 235603 From firstname.lastname@example.org Wed Dec 31 10:38:50 2014 Subject: example2 Folder: /dev/null 5983 From email@example.com Wed Dec 31 10:38:50 2014 Subject: example3 -> Full Offline Backup DEV Folder: /dev/null 40978 From firstname.lastname@example.org Wed Dec 31 10:38:50 2014 Subject: [OK] [ example4] Folder: /dev/null
So these mails are received during a day, and they must be there at a certain time when I need to check if every mail has arrived (exists in the log file). Now I need a way to see if each of these mails are present in the log. And it can be searched just by the from line.