Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: SMTP and TLS

by thewebsi (Scribe)
on Jan 27, 2012 at 01:19 UTC ( #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

    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
    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 ESMTP SimpleEmailService-200596653
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950247]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2018-03-25 01:39 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.