SMTP and SSL Socket Issue

Posted by drew_sav on 14-Dec-2009 16:29

Hi guys,

I'm having a few issues creating a socket that uses SSL to a mail server (smtp.gmail.com). The issue is that it seems to connect fine, but no matter what i send it never seems to return a response. Is this standard op for a TLS/SSL mail server? The only thing i can think of is to just write all the data for sending the mail in one hit, but then i'm not sure how you could do any error handling.

Is there anyone here who has worked with the gmail SMTP servers, or knows a bit about sending through SSL connections?

Thanks,

Andrew

All Replies

Posted by jbijker on 29-Oct-2015 03:16

I'm getting the same behaviour.

What seems to be happening is the SSL layer is caching the response. So whenever I send a command over I'll get the initial response (220 server ready), then wait forever for my command's response (250 OK) unless I send something else.

Any ideas how I can turn off this caching?

Posted by Donicello Lampe on 29-Oct-2015 04:05

You may try the -nosessionreuse parameter within the CONNECT() method.

Posted by jbijker on 29-Oct-2015 04:11

I've tried that but no success.

I've also set the SO-RCVBUF socket option from the default 65536 to 16, but it made no difference.

The only way I see around this is to send an extra NOOP command after every real command, just to get the first command's response back.

This thread is closed