Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: SMTP and TLS

by thewebsi (Scribe)
on Jan 27, 2012 at 01:19 UTC ( [id://950247]=note: print w/replies, xml ) Need Help??


in reply to SMTP and TLS

HELO adsf
Connection closed by foreign host.

The telnet test certainly does away with any theory that the port might be blocked. It is clearly open, and there is a listener on the other end. However, your scripts go much further than this, actually attempting to negotiate an encrypted connection, log in, and even send a message. The script is likely failing at a later stage.

At this point, I would want to test the server to see if it indeed supports TLS, the authentication information you have is correct, and that you are allowed to use it to send messages. The server might be set up to hang if it's not happy with the transaction (this is a common way to slow down spambots). Unfortunately, this behaviour may mean that you won't get much in the way of useful error messages (as you've already noticed).

I've used this guide before to test SMTP servers for access. It uses command-line tools, but you can certainly use Net::SMTP for example to achieve the same. Note that this is unlikely to be an issue particular to Perl.

Replies are listed 'Best First'.
Re^2: SMTP and TLS
by Rodster001 (Pilgrim) on Jan 27, 2012 at 17:38 UTC
    I did get a response from Amazon:
    At the moment, the Amazon SES SMTP interface supports connections wrapped with TLS. This means that the telnet command won't work as a troubleshooting mechanism. With OpenSSL installed, try the following:

    openssl s_client -quiet -crlf -connect email-smtp.us-east-1.amazonaws.com:465

    After establishing a TLS connection, we will provide the typical SMTP banner.

    So, I gave that a shot and:
    # openssl s_client -quiet -crlf -connect email-smtp.us-east-1.amazonaws.com:465
    depth=2 /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
    verify error:num=20:unable to get local issuer certificate
    verify return:0
    220 email-smtp.amazonaws.com ESMTP SimpleEmailService-200596653
    quit
    221 Bye
    I need to do a little bit of investigation, not sure if that issue is on my end or theirs. I also tried another package (Net::SMTP::TLS). But it too just hangs on connect.

    Let me know if you have any ideas, otherwise I will post what I find here.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950247]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found