I need to do a bulk mailing _again_ (don't worry this is to service subscribers about the actual service) and it’s occurred to me that I really need to check whether the remote end actually accepts the mail.

Now I could start parsing mailserver logs, but in this specific situation I can't help but wonder why I don't just resolve the MX records within the mailer script and send directly (assuming I identify myself correctly and don't have a blackholed IP) that way I could get a return status from Net::SMTP and properly record the transaction.

Now I assumed that someone would have already wrapped up Net::DNS and Net::SMTP in a direct sender module but my searches seem to only turn up perl SMTP receivers or senders that assume an upstream server. I'll write it myself if no one had done it, but I'm guessing there are a few gotya's in there somewhere and would prefer use known modules if available.

Has anyone come across such a thing? If not any guesses why it doesn't exist? I'm sure plenty of mail applications would like to know that the mail was received by the far destination successfully.


Thank for the replies so far. Just to clear a few things up. I'm already parsing bounce massages (the messages already contain unique ID's that can be read out of the bounce) however I'd like to recover the actual SMTP status as I'm finding more and more MTA replying with "temporary" failures when the problem will never be resolved. Additionally there are plenty of our customers whose MTA's don't generate NDR's .

Thanks for pointing out some of the gotyas but I guess people havn't written this yet as they don't perceive they need it or they parse their mailserver logs. Perhaps there is a niche here for me to contribute as I'm still convinced I need it.

In reply to Direct SMTP send with full resolution. by SilentMobius

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.