We have an external system which happens to fail from time to time. We don't have direct access to the logs of this system, all we get are daily status mails delivered to our Inbox indicating failure or success. Now what we're trying to achieve is counting failure and success messages to somehow measure reliability.
If we would have access to the logs, this would be fairly easy using grep and wc and that kind. But all we have is a bunch of mails.
Now heres the question: Can somebody come up with way to connect to an imap-server, go to a specific folder, get all messages and count a certain string? (preferably bash, python or perl). We don't expect the exact command. Some ideas to get us started would be great.