Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I want to send a email. Here my working example on ubuntu:

sendEmail -f <FROM_EMAIL> -t <TO_EMAIL> -u 'Book' -m 'ISBN: 12345-678-90' -s smtp.gmail.com -o message-charset=utf8 -o tls=yes -xu <USERNAME> -xp <PASSWORD>

On the raspberry i get an error:

invalid SSL_version specified at /usr/local/share/perl/5.14.2/IO/Socket/SSL.pm line 332

I have no idea, what ist wrong. Has anyone an idea, how to solve the problem? Alternarive - an replacement for the sendEmail without own smtp server?

share|improve this question
    
What distro are you using and is it up to date? –  Jivings Oct 7 '12 at 13:07
    
I'm using the raspbian wheezy and yes - it is up to date. –  cupakob Oct 7 '12 at 13:14

4 Answers 4

The bug appears to be in line 1490 of /usr/local/share/perl/5.14.2/IO/Socket/SSL.pm.

The SSL_version is being coded as "SSLv3 TLSv1" and the regular expression is failing.

I hacked it as a workaround as follows...

change:

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

to:

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

That did the trick for me.

share|improve this answer
    
nice, i must try it :) –  cupakob Nov 12 '12 at 20:26
    
works, but i've used the /usr/share/perl5/IO/Socket/SSL.pm. Thanks a lot... –  cupakob Nov 13 '12 at 16:39
up vote 3 down vote accepted

...it seems to be a bug in Debian:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679911

and here replacement for sendEmail:

http://www.logix.cz/michal/devel/smtp-cli

Now i can send email with this command:

smtp-cli --verbose --host smtp.gmail.com --user <USER> --auth-plain --from <FROM_EMAIL> --to <TO_EMAIL> --pass <PASSWORD> --subject "Test" --body-plain "Log files are attached."

smtp-cli --verbose --host smtp.gmail.com --user abcde --auth-plain --from abcde@gmail.com --to fggga@gmail.com --pass topSecret --subject "Test" --body-plain "Log files are attached."
share|improve this answer

After installing sendemail on Raspberry pi, there will be an error

"No TLS support!".

To fix it, install tls packages:

sudo apt-get install libnet-ssleay-perl libio-socket-ssl-perl

or

sudo apt-get install libio-socket-ssl-perl libnet-ssleay-perl

Then after running "sendemail", we will get the error

"invalid SSL_version specified at /usr/local/share/perl/5.14.2/IO/Socket/SSL.pm line 332"

Method below works:

sudo nano usr/share/perl5/IO/Socket/SSL.pm

then change

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

to:

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

Another reason for SSL failure is the time used for time stamping the communications. Make sure that the system time on the Pi is current.

Either run ntpd or run sudo ntpdate <some time server>. ntpd corrects the system time in small increments. if your time is off by hours, it will take days to fix it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.