peteredhair has asked for the wisdom of the Perl Monks concerning the following question:
i'm posting in search for help as i'm a newbie to perl and i'm returning to development recently to solve some management problems.
I setup and have Navios checking services at my data processing site. Navios works great and does it's simple job very efficiently, when there's a problem it'll raze the flag.
However i have a lot of applications, and app webservices, for which the only visibility i have is an email they send reporting their status or job/processing result status, for instance, an app report that it found 200 files to process, or received 200 web services requests and there was an error on 15 of them.
They report this in a HTML email with a table of the corresponding files or requests to process and how many had error.
I need to read these emails, find which ones correspond to problems and then summarise this as a report or inject this to Nagios.
I need help in processing the emails headers and body as some of them come encoded in uff8 or other forms of encoding (and also a lot of html in the body), a specific exemple is for example for the subject or from header field:
Subject: =?UTF8?B?5LuO5Y2a5a6i5paH56ug5Lit5p+l5om+5oKo5oSf5YW06Laj55qE5Li7?==?U +TF-8?B?6aKY?= =?UTF8?B?it5p+l5om+5oKo5oSf5YW06Laj55?=
The header returns this in separate lines.
i'm learning perl by example and couldn't find a simple but fast solution to this.
However found a python sample code that will do all this at https://github.com/akkana/scripts/blob/master/decodemail.py Is there something similar already done for perl ? it'll solve my first big issue and allow me to move on to the other parts of my app, and learn in the way
Sorry for the long post and thanks in advance.
Peteredhair
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eMail processing for alarmistic
by hippo (Archbishop) on Apr 28, 2018 at 12:21 UTC | |
by peteredhair (Novice) on Apr 28, 2018 at 20:04 UTC | |
by peteredhair (Novice) on May 07, 2018 at 23:48 UTC |