Re: infinite loop when server expects SSL

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

"Rasmus W" <> wrote in message

> I am experiencing problems when trying to send a message to a
> mail server which requires SSL (STARTTLS) (the mail server is
> 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 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

Remy Lebeau (TeamB)



In response to

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