Sendmail bug

While working on this little script (Monitoring) I ran into a bug from 2012, which was easy to fix as well.

When running the sendemail command in order to send a mail (that’s what it says, right?), I got an error:

sendEmail -f xxx@example.com -t recipient@example.com -u Test -m 'This is a test' -s smtp.example.com:587 -xu xxx_user -xp xxx_pw -o tls=yes
sendemail: invalid SSL_version specified at /usr/share/perl5/IO/Socket/SSL.pm

This is mentioned in this bug-report. And the solution is as listed quite simple:

Replace

m{^(!?)(?:(SSL(?:v2|v3|v23|v2/3))|(TLSv1[12]?))$}i

with

m{^(!?)(?:(SSL(?:v2|v3|v23|v2/3))|(TLSv1[12]?))}i

In the mentioned file. The line number is not the one for the regex. Searching for TLSv1 matched the regex in line 1602 in my case.

Update:

After doing this little change experienced some problemsm with the Perl Module LWP::UserAgent and connecting throug HTTPS.

Error: 500 Can't connect to example.com:443

After some digging and enabling SSH debugging in perl through

use IO::Socket::SSL qw(debug3);

I found this site pointing me into the right direction:

Reinstalling the Perl Module IO::Socket::SSL via CPAN resolved the issue here:

$ CPAN
install IO::Socket::SSL