Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Mail::Sender script fails upon Linux (and Perl) update

by dneill8 (Initiate)
on Jan 03, 2014 at 21:57 UTC ( #1069205=perlquestion: print w/replies, xml ) Need Help??

dneill8 has asked for the wisdom of the Perl Monks concerning the following question:

A script that was operational for every 2 weeks for 2 years failed when I moved it to a ubuntu 12.04 LTS system Linux 3.8.0-34-generic Perl (v5.14.2) The modules in use are the following - I've included the version numbers for those I think might be involved in the problem:

use warnings; use DBI; use Text::CSV_XS; use Text::CSV; use Net::SMTP::SSL; 1.01 use MIME::Base64; use File::Spec; use LWP::MediaTypes; 6.01 use Date::Calc qw(:all); use Mail::Sender; 0.8.22
The mail server being used is our Exchange Server, via a local IP address. I think the change may be a more-enforeced requirement for certificates OR I need to install the server's certificate on this new Linux system. The operative part of the script that is throwing the error is:

open my $DEBUG, ">> //root/FAVOR_Data_Reports_scripts/debug_file_gen_a +nd_mail_adv_reports.txt" or die "Can't open the debug file: $!\n"; ref ($sender = new Mail::Sender({from => '',smt +p => ''})) or die "$Mail::Sender::Error\n"; (ref ($sender->MailFile( {to =>'', subject => "FY 2012-13 - All Open +EOCs - Advocates Report for ".$report_date, msg => "\nAttached is the FAVOR Advocates Report for All Open +EOCS - 2012-2013", debug => $DEBUG, debug_level => 4, file => $advocates_report_filename })) and print "Mail sent OK." ) or die "$Mail::Sender::Error\n";

The error this produces is:

IO::Socket::SSL->start_SSL failed: SSL connect attempt failed with unk +nown errorerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:cer +tificate verify failed

The debug file created when the script is run shows:

>> 220 Microsoft ESMTP MAIL Service ready at Sat, 28 D +ec 2013 13:28:21 -0500 << EHLO localhost >> Hello [] >> 250-SIZE 36700160 >> 250-PIPELINING >> 250-DSN >> 250-ENHANCEDSTATUSCODES >> 250-STARTTLS >> 250-AUTH NTLM >> 250-8BITMIME >> 250-BINARYMIME >> 250 CHUNKING << STARTTLS >> 220 2.0.0 SMTP server ready

I looked at the log on the Exchanger Server and this is what's going on on that end - Exchange sends a certificate verification and I'm not sure what to do with that (the line numbers on the left were put inserted so we can use references):

1 2014-01-02T10:24:35.047Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,0,,,+,, 2 2014-01-02T10:24:35.047Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,1,,,*,SMTPSubmit SMTPAcceptAnySender +SMTPAcceptAuthoritativeDomainSender AcceptRoutingHeaders,Set Session +Permissions 3 2014-01-02T10:24:35.047Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,2,,,>,"220 Micros +oft ESMTP MAIL Service ready at Thu, 2 Jan 2014 05:24:34 -0500", 4 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,3,,,<,EHLO localhost, 5 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,4,,,>, Hello [ +], 6 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,5,,,>,250-SIZE 36700160, 7 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,6,,,>,250-PIPELINING, 8 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,7,,,>,250-DSN, 9 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,8,,,>,250-ENHANCEDSTATUSCODES, 10 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,9,,,>,250-STARTTLS, 11 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,10,,,>,250-AUTH NTLM, 12 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,11,,,>,250-8BITMIME, 13 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,12,,,>,250-BINARYMIME, 14 2014-01-02T10:24:35.094Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,13,,,>,250 CHUNKING, 15 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,14,,,<,STARTTLS, 16 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,15,,,>,220 2.0.0 SMTP server ready, 17 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,16,,,*,,Sending certificate 18 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,17,,,*,", OU +=Domain Control Validated",Certificate subject 19 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,18,,,*,"SERIALNUMBER=07969287, CN=Go +Daddy Secure Certification Authority, OU= +com/repository, O=""GoDaddy.c om, Inc."", L=Scottsdale, S=Arizona, + C=US",Certificate issuer name 20 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,19,,,*,4B7D04F464AD8A,Certificate ser +ial number 21 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,20,,,*,C3B8E4FF095318BBE93F4D26ACA11E +6218481790,Certificate thumbprint 22 2014-01-02T10:24:35.140Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,21,,,*,;www.web;,Certificate alternate names 23 2014-01-02T10:24:35.281Z,EXCHSERVER\Relay Receive,08D0C0F3026261AE +,22,,,-,,Local

Replies are listed 'Best First'.
Re: Mail::Sender script fails upon Linux (and Perl) update
by wazat (Monk) on Jan 04, 2014 at 05:23 UTC

    This looks like one of those problems where it is easy to fall down a rabbit hole.

    I don't have experience with this problem, so be careful I don't send you down one of those rabbit holes.

    $sender = new Mail::Sender({from => '',smtp => ''})

    For exploration purposes, reading IO::Socket::SSL docs it looks like you might be able to disable the client side from verifying the certificate. If that hides the problem then that suggests the problem is in the certificate verification.

    SSL_verify_mode => SSL_VERIFY_NONE

    From the server log line 22, it looks like the certificate is for "", while your script is connecting via IP address. Does it make a difference if you specify "" instead of the IP address?

    A quick google for godaddy CA openSSL returns some results that may be apropos, or perhaps just a very deep rabbit whole.

      Your observations on rabbit holes are very much appreciated. I'll check out what you recommend and post back.
Re: Mail::Sender script fails upon Linux (and Perl) update
by noxxi (Pilgrim) on Jan 05, 2014 at 18:13 UTC
    It's a known bug in Mail::Sender, see there work a workaround: RT#85438
Re: Mail::Sender script fails upon Linux (and Perl) update
by dneill8 (Initiate) on Jan 03, 2014 at 22:01 UTC
    Sorry folks - in the above and should be the same value - I obscured in two different steps and forgot to make the second the same - it's all happening in the same domain. TIA.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1069205]
Approved by kevbot
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2023-06-08 15:26 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (34 votes). Check out past polls.