Hi Monks,

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


In reply to eMail processing for alarmistic by peteredhair

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.