I have Perl scripts running 24x7 on three different severs. The scripts perform different functions, such as importing data, creating reports, etc. However, the last thing each script does is send me an e-mail alert using the email::stuffer CPAN module. Here is a snippet of the code:


Email::Stuffer->from ($From) ->to ($To) ->cc ($CC) ->bcc ($BCC) ->subject ($Subject) ->text_body($Body) ->transport('SMTP', { host => '[address of my co +mpany’s mailrelay]' }) ->send;

One of the scripts has been running since 2006 on a windows server. Another since approximately 2014 on a linux server and the third script was created in October 2018 on a windows server. Therefore, the CPAN versions are different. I.E. the CPAN versions on the oldest server (2006) and newest (2018) are different, but the e-mails have *always* been sent.


Starting on April 14, 2020, the e-mail alerts from all three servers were not consistently arriving in my Outlook inbox. In other words, the e-mails would arrive just fine, then suddenly stop. A short time later, usually between 15 to 75 minutes later, the e-mails would start arriving again. Even though the scripts run 24x7, the outages always occur somewhere between 11:45 AM and 1:30 PM. I did verify that the data imports worked and the reports were generated. To simplify matters, I created a script that does nothing but send a "Hello World" message.


At first, I thought there was something wrong on the mailrelay server, but NetOps investigated and did not find anything wrong. NetOps provided a spreadsheet showing the inbound requests and sure enough, my e-mails were not on the list.


I added additional logic to the Perl script to record what was happening. Per the below, the e-mail at 12:01 PM was sent OK, but the e-mail at 12:16 PM was not.


2020-04-29 12:01:02 Begin test e-mail

2020-04-29 12:01:03 Email sent - **return code: Email::Sender::Success__WITH__Email::Sender::Role::HasMessage**=HASH(0x3617838)

2020-04-29 12:01:03 Done with test e-mail


2020-04-29 12:16:02 Begin test e-mail

2020-04-29 12:16:03 Email sent - **return code:**

2020-04-29 12:16:03 Done with test e-mail


I brought in a fresh copy of the CPAN email::stuffer on one of the older windows servers, but that has not made any difference. According to the CPAN documentation, there are dependencies (Carp, Email::MIME, Email::MIME::Creator, Email::Sender::Simple, File::Basename, Module::Runtime, Params::Util, Scalar::Util, strict, warnings), but I didn’t see those updated and assume that is OK.


Has anyone seen this issue before? Any ideas on how to proceed would be greatly appreciated.


Thanks,
Brian

In reply to email::stuffer not always sending messages by Brian4321

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.