Re: infinite loop when server expects SSL

Giganews Newsgroups
Subject: Re: infinite loop when server expects SSL
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Wed, 26 Aug 2009

"Rasmus W" <r-remove-w@blue-remove-position.com> wrote in message
news:FB998EC0568EE340r-remove-w@blue-remove-position.com...

> I am experiencing problems when trying to send a message to a
> mail server which requires SSL (STARTTLS) (the mail server is
> smtp.gmail.com). It seems that when TIdSMTPBase.SendPipeLining
> sends MAIL FROM, the server returns an error which is "530 Must
> issue a STARTTLS command first". SendPipeLining receives the
> error and stores it in LError, but does no checking on that before it
> sends RCPT TO.

It is not supposed to.  That is the whole point of Pipelining - it allows
multiple commands to be sent at one time, and then all of the replies have
to be read together.  This way, as few TCP packets as possible are used.
Even if one command fails, all of the subsequent replies still have to be
read before any validation can occur.  Read RFC 2920
http://www.rfc-editor.org/rfc/rfc2920.txt) for more details.

> While waiting for the response to RCPT TO it then waits forever
> (well, almost. - the while loop in TIdIOHandler.ReadLnWait waits
> until MaxInt passes).

SendPipelining() is not supposed to wait for the RCTP TO reply(s) until
after it has sent the entire batch of commands, ending with the DATA
command, and after it has read the MAIL FROM reply.  It does not wait for
each reply after sending each command, like SendNoPipelining() does.

> I am using the Delphi 2007 built-in Indy10.

You are using an outdated version of Indy 10.  Please upgrade to a newer
version.

--
Remy Lebeau (TeamB)

Replies

None

In response to

infinite loop when server expects SSL posted by Rasmus W on Wed, 26 Aug 2009