Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get Amazon SES working on Debian Squeeze?

All the Perl dependencies for it are met but I'm getting this error:

Can't locate object method "ssl_opts" via package "LWP::UserAgent" at SES.pm line 250.

like image 396
Sarel Botha Avatar asked Aug 10 '11 13:08

Sarel Botha


People also ask

How do I know if AWS SES is working?

You can use the Test-NetConnection cmdlet in PowerShell to connect to the Amazon SES SMTP server. The Test-NetConnection cmdlet can determine whether your computer can connect to the Amazon SES SMTP endpoint.

Is AWS SES deprecated?

To enhance the security of Amazon SES customers, beginning October 1, 2020, support for Signature Version 3 will be turned off (deprecated) in Amazon SES, and only Signature Version 4 will be supported going forward.

Is Amazon SES MTA?

Amazon Simple Email Service (SES) is a hosted email service for you to send and receive email using your email addresses and domains. Typically SES used for sending bulk email or routing emails without hosting MTA. We can use Perl/Python/PHP APIs to send an email via SES.


2 Answers

I just wanted to document what I had to do to get this running on my Debian system. The solution for Ubuntu is probably the same.

First, to let Perl find SES.pm make the directory /usr/local/lib/site_perl and copy SES.pm there. I prefer this solution over what the README recommends.

Your system probably has a lot of the dependencies met already so instead of installing duplicate packages just check first which ones it needs. To do that run these commands. If it gives an error it's not met:

perl -e 'use Crypt::SSLeay'
perl -e 'use Digest::SHA'
perl -e 'use Bundle::LWP'
perl -e 'use LWP::Protocol::https'
perl -e 'use MIME::Base64'
perl -e 'use Crypt::SSLeay'
perl -e 'use XML::LibXML'

I had to remove the package libcrypt-ssleay-perl because it's not compatible with this Amazon script. With it the script produces the error in the question.

I installed these packages from Debian:

libxml-libxml-perl
libssl-dev (needed to compile dependencies)

To find out which package contains the Perl module you need use this page on the Debian site to search the contents of packages: http://www.debian.org/distrib/packages

Replace the :: in the package with / and put .pm at the end. For example if you need XML::LibXML search for XML/LibXML.pm

I installed these packages from CPAN. It takes a little while though. There are a lot of dependencies.

perl -MCPAN -e 'install LWP::Protocol::https'
perl -MCPAN -e 'install Crypt::SSLeay'
like image 111
Sarel Botha Avatar answered Sep 24 '22 17:09

Sarel Botha


Comment out line 250 in SES.pm, as follows:

# $browser->ssl_opts(verify_hostname => 1);

Then it will run. Probably less secure. But it runs.

like image 41
user81779 Avatar answered Sep 23 '22 17:09

user81779