Sendemail on Linux Debian Wheezy gives errors on gmail and gmx accounts

3.8k Views Asked by At

I am using the SendEmail SMTP client (http://caspian.dotconf.net/menu/Software/SendEmail/) on a Beaglebone black running the Debian Wheezy Linux distro.

This tool is exactly what I need but I am having a few problems with it. Bear in mind that I am a Linux Newbie.

Firstly, the latest SendEmail package for Debian Wheezy is 1.56-2 (https://packages.debian.org/source/wheezy/sendemail). A later package (1.56-5) is available for other Debian distros (e.g. Sid/Jessie) but not for Wheezy. Anyone know why this is?

I have also using libio-socket-ssl-perl 1.76-2, libnet-ssleay-per 1.48-1+b1, perl 5.14.2-21+deb7u2.

Secondly, I am testing using GMAIL and GMX accounts on ports 465 and 587. Note that I have tested these using a different OS (not Linux) with my own SMTP client with PolarSLL and the accounts all work OK.

However, they do not seem to work when using SendEmail on Linux Debian Wheezy. The problems I am having are:

GMAIL port 587 (STARTTLS)  FAILS:
Jun 12 10:39:55 beaglebone sendEmail[3686]: DEBUG => My IP address is: 192.168.1.224
Jun 12 10:39:55 beaglebone sendEmail[3686]: SUCCESS => Received:        220 mx.google.com ESMTP ha4sm2142303wib.0 - gsmtp
Jun 12 10:39:55 beaglebone sendEmail[3686]: INFO => Sending:    EHLO beaglebone
Jun 12 10:39:55 beaglebone sendEmail[3686]: SUCCESS => Received:        250-mx.google.com at your service, [92.19.250.250], 250-SIZE 35882577, 250-8BITMIME, 250-STARTTLS, 250-ENHANCEDSTATUSCODES, 250-PIPELINING, 250-CHUNKING, 250 SMTPUTF8
Jun 12 10:39:55 beaglebone sendEmail[3686]: INFO => Sending:    STARTTLS
Jun 12 10:39:55 beaglebone sendEmail[3686]: SUCCESS => Received:        220 2.0.0 Ready to start TLS
invalid SSL_version specified at /usr/share/perl5/IO/Socket/SSL.pm line 332

Various forums mention that the fix/workaround for this is to change line 1490 in "SSL.pm"

from

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

to

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

This does fix the problem. Perhaps this fix is not required if 1.56-5 was available for Wheezy?

The following accounts give the same results regardless of whether the above fix is implemented or not.

GMAIL port 465 (SSL) FAILS:
Jun 12 10:32:43 beaglebone sendEmail[3537]: DEBUG => Connecting to smtp.gmail.com:465
Jun 12 10:32:43 beaglebone sendEmail[3537]: DEBUG => My IP address is: 192.168.1.224
Jun 12 10:33:43 beaglebone sendEmail[3537]: ERROR => Timeout while reading from smtp.gmail.com:465 There was no response after 60 seconds.

GMX port 587 (STARTTLS)  FAILS:
Jun 12 10:35:12 beaglebone sendEmail[3586]: DEBUG => Connecting to mail.gmx.com:587
Jun 12 10:35:13 beaglebone sendEmail[3586]: DEBUG => My IP address is: 192.168.1.224
Jun 12 10:35:13 beaglebone sendEmail[3586]: SUCCESS => Received:        220 gmx.com (mrgmx103) Nemesis ESMTP Service ready
Jun 12 10:35:13 beaglebone sendEmail[3586]: INFO => Sending:    EHLO beaglebone
Jun 12 10:35:13 beaglebone sendEmail[3586]: SUCCESS => Received:        250-gmx.com Hello beaglebone [92.19.250.250], 250-SIZE 69920427, 250-AUTH LOGIN PLAIN, 250 STARTTLS
Jun 12 10:35:13 beaglebone sendEmail[3586]: INFO => Sending:    STARTTLS
Jun 12 10:35:13 beaglebone sendEmail[3586]: SUCCESS => Received:        220 OK
Jun 12 10:35:13 beaglebone sendEmail[3586]: ERROR => TLS setup failed: SSL connect attempt failed with unknown error error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

GMX port 465 (SSL) FAILS:
Jun 12 10:36:23 beaglebone sendEmail[3619]: DEBUG => Connecting to mail.gmx.com:465
Jun 12 10:36:23 beaglebone sendEmail[3619]: DEBUG => My IP address is: 192.168.1.224
Jun 12 10:36:33 beaglebone sendEmail[3619]: ERROR => mail.gmx.com:465 returned a zero byte response to our query.

Can anyone help?

Thanks

3

There are 3 best solutions below

0
On

In my case I had installed ca-certificates, but the package was broken. So I need to reinstall it. The fix was done by update-ca-certificates script (it regenerates certificates in /etc/ssl/certs as part of postinstallation script):

apt install --reinstall ca-certificates
0
On

I solved it by changing

if (! IO::Socket::SSL->start_SSL($SERVER, SSL_version => 'SSLv3 TLSv1')) {        

to

if (! IO::Socket::SSL->start_SSL($SERVER, SSL_version => 'TLSv1')) {

in the sendEmail file.

0
On

I have same error (in debian jessie), and I solved installing package ca-certificates

apt-get install ca-certificates