When I first learned that sendmail could pipe incoming messages to a program, a number of interesting possibilities occurred to me. One that I'm especially interested in exploring is the idea of stuffing messages from a mailing list into a database, thus giving me ways to search by sender, subject, full-text...

So as a first step, I whopped up a simple script that just prints STDIN to a temp file, so I could see exactly what was coming in and get a handle on how to parse it.

This led to exploration of MIME types, base64 encoding, and various other things.

My question: Is this a reasonable way to be doing this, or would it be easier (from the standpoint of processing the mail) to let the mail flow into a mailbox, and then parse it from there?

One way gives real time processing; the other would obviously have to be a periodic cron job.

I poked around briefly on CPAN, and was overwhelmed by the sheer number of modules that deal with email in one fashion or another. Anybody got favorites?

--Ian


In reply to Handling Incoming Mail by Ian the Terrible

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.