login about faq

I'm using the CkMailMan object's VerifySmtpConnection method to verify SMTP details. In a previous build of the Chilkat library (from about a year ago) this worked fine. With the latest version (downloaded last week), however, it is returning false for exactly the same code. This is the lastErrorText after the failed response (a few details altered for privacy):

ChilkatLog:
  VerifySmtpConnection:
    DllDate: Dec 12 2012
    UnlockPrefix: [...snipped...]
    Username: NICK:Nick
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 9.0
    VerboseLogging: 1
    Checking TCP/IP connectivity to the SMTP server.
    This does not check the login/password.
    AutoFix: SMTP port 25 is typically for unencrypted or explicit SSL/TLS.
    To prevent auto-fix, set the AutoFix property = False/0
    Checking connectivity to SMTP server [...snipped...]:25
    smtp_host: [...snipped...]
    smtp_port: 25
    ConnectTimeoutMs_1: 30000
    calling ConnectSocket2
    IPV6 enabled connect with NO heartbeat.
    connectingTo: [...snipped...]
    resolveHostname1:
      dnsCacheLookup: [...snipped...]
      dnsCacheHit: [...snipped...]
    --resolveHostname1
    GetHostByNameHB_ipv4: Elapsed time: 0 millisec
    myIP_1: 192.168.1.30
    myPort_1: 2520
    connect successful (1)
    clientHelloMajorMinorVersion: 3.1
    buildClientHello:
      majorVersion: 3
      minorVersion: 1
      numRandomBytes: 32
      sessionIdSize: 0
      numCipherSuites: 10
      numCompressionMethods: 1
    --buildClientHello
    readIncomingTls_serverHello:
      readTlsRecord:
        Timeout waiting to read socket or accept connection
        timeoutMs: 30000
        Failed to read TLS record (2)
        tlsRec_msg: 91
        msgLen: 8307
      --readTlsRecord
    --readIncomingTls_serverHello
    Expected ServerHello but did not receive it.
    Client handshake failed. (3)
    Failed to connect to SMTP server.
  --VerifySmtpConnection
  Failed.
--ChilkatLog

From the previous, working, build of Chilkat libraries, this is the last error text after VerifySmtpConnection succeeds:

ChilkatLog:
  VerifySmtpConnection:
    DllDate: Jan  6 2011
    UnlockPrefix: [...snipped...]
    Username: Nick
    Component: Visual C++ 9.0
    Checking TCP/IP connectivity to the SMTP server.
    This does not check the login/password.
    Checking connectivity to SMTP server [...snipped...]:25
    smtp_host: [...snipped...]
    smtp_port: 25
    ConnectTimeoutMs: 30000
    calling ConnectSocket2
    Connect using IPV4.
    Invalid protocol number
    ai_protocol: 0
    ipAddress: [...snipped...]
    socketHandle: 0x3d4
    ai_addrlen: 16
    ai_addr: 0200 0019 3EAC AF8A 0000 0000 0000 0000

    myIP_3: 192.168.1.30
    myPort_3: 2454
    connect successful.
    ESMTP server [...snipped...]:25 is reachable
    Success.

There's quite a lot different there. Where am I going wrong? I'm setting the SmtpHost, SmptUsername, SmtpPassword, SmtpSsl and SmtpLoginDomain settings before calling VerifySmtpConnection. I've tried with AutiFix set to true and false - same result.

To note, the Username field in the lastErrorText is different from the previous build to the current build; current build shows my machine name prefixed to my username (NOT the domain name), whereas previous build only shows the username (no domain or machine prefix).

Also if it is of interest, the test for the current chilkat build takes about twice as long as the previous one (though that may be due to it failing somewhere...).

Thanks for any advice!

asked Feb 08 '13 at 05:46

njshaw2's gravatar image

njshaw2
6223


Notice this part of the LastErrorText:

AutoFix: SMTP port 25 is typically for unencrypted or explicit SSL/TLS.
To prevent auto-fix, set the AutoFix property = False/0

What is it that you really need? Port 25 with no encryption? with implicit SSL? or with explicit (STARTTLS) SSL? w/ implicit SSL (i.e. SmtpSsl = true), the customary SMTP port is 465. When using port 25, you would expect either no SSL or explicit SSL. If the server is confusingly setup to do implicit SSL on port 25, make sure to set AutoFix = false.

link

answered Feb 08 '13 at 08:35

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Setting AutoFix to false made no difference, but I'll try port 465, and with SSL explicitly disabled...

(Feb 08 '13 at 08:39) njshaw2

With SSL set to false, it connects to the SMTP server but fails the login check. With AutoFix set to false, it does exactly the same as with SSL on or off. With the port set to 465, it fails to connect (so I guess that port isn't open on my mail server).

I've managed to get it working though, going through the intranet instead of via the internet to the mail server (SSL disabled, AutoFix=false), so looks to be a strange mail server configuration.

What I don't understand is how this works ok with a previous Chilkat build, but not the latest...

(Feb 08 '13 at 09:22) njshaw2
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×184
×47

Asked: Feb 08 '13 at 05:46

Seen: 2,245 times

Last updated: Feb 08 '13 at 09:22

powered by OSQA