Board index » delphi » problem with tidSMTP after installing latest dev snapshot available (23 Aug)

problem with tidSMTP after installing latest dev snapshot available (23 Aug)


2006-08-24 07:04:37 PM
delphi165
Hi,
I installed the latest Indy dev snapshot as suggested to see if it
would solve the problem I had (see thread "wrong hour when sending an
e-mail" from 22nd Aug)
This problem was solved by the dev snapshot, although I have a new one
now :(
The message is sent correctly, but now I get an exception
EidSMTPReplyError with message 'unimplemented (#5.5.1)
I have tracked to the execution of the Disconnect method, concretely in
the line
SendCmd('QUIT', 221); //in the DisconnectNotifyPeer method
Now, I know QUIT command is the one used to close a SMTP connection and
I know my mail server has no problem, so either something did not
install properly or I have missed some detail.
Any ideas???
--
Best regards :)
Guillem Vicens Meier
Dep. Informática Green Service S.A.
www.clubgreenoasis.com
Contribute to the Indy Docs project: docs.indyproject.org
In order to contact me remove the -nospam
 
 

Re:problem with tidSMTP after installing latest dev snapshot available (23 Aug)

"Guillem" <XXXX@XXXXX.COM>writes
Quote
The message is sent correctly, but now I get an exception
EidSMTPReplyError
That exception is thrown when TIdSMTP sends a command to the server and the
server sends back an error reply.
Quote
with message 'unimplemented (#5.5.1)
That means that the server does not support the command that TIdSMTP sent.
The only way to diagnose that is to obtain a capture of the actual SMTP
command/response traffic with a packet sniffer, such as Ethereal
(www.ethereal.com), to see which command is actually failing.
Quote
I have tracked to the execution of the Disconnect method,
concretely in the line

SendCmd('QUIT', 221); //in the DisconnectNotifyPeer method
There is no way any SMTP server is going to send an "unimplemented" error
for the QUIT command. QUIT is a required command in the SMTP protocol.
Email messages cannot be sent to the specified recipients unless the server
supports the QUIT command.
Without seeing your actual code, or the actual SMTP traffic, the only thing
I can think of is that an earlier command was sent to the server without
reading the response, so the error reply remained in the inbound buffers
until another command was sent, which in this case happened to be the QUIT
command.
Gambit
 

Re:problem with tidSMTP after installing latest dev snapshot available (23 Aug)

Remy Lebeau (TeamB) writes:
Quote
That means that the server does not support the command that TIdSMTP
sent. The only way to diagnose that is to obtain a capture of the
actual SMTP command/response traffic with a packet sniffer, such as
Ethereal (www.ethereal.com), to see which command is actually
failing.
done so. The results are quite strange. It is different if depending on
if I send it in or outside the IDE.
Can't export them to text file because I get some "path not found"
error from Ethereal when I try to do so. I copy it all here in the same
order. C-S means client to server while S-C means the opposite. All
these packets are SMTP unless otherwise specified.
when executing from the IDE
===========================
S-C Response: 220 myserver.com ESMTP
C-S Command: EHLO Desarrollo
S-C Response: 250-myserver.com
C-S Command: RSET
S-C Response: 250 flushed
C-S Command: MAIL FROM: <XXXX@XXXXX.COM>
S-C Response: 250 ok
C-S Command: RCPT TO: <XXXX@XXXXX.COM>
S-C Response: 250 ok
C-S Command: RCPT TO: <XXXX@XXXXX.COM>
S-C Response: 250 ok
C-S Command: DATA
S-C Response: 354 go ahead
C-S Message Body
TCP S-C smtp>3751 [ACK] Seq=170 Ack= 1038 Win=7056 Len=0
C-S EOM:
TCP S-C smtp>3751 [ACK] Seq=170 Ack= 1043 Win=7056 Len=0
S-C Response: 250 ok 1156510725 qp27397
C-S Command: QUIT
S-C Response: 502 unimplemented (#5.5.1)
S-C Response: 221 myserver.com
when executing outside the IDE
==============================
S-C Response: 220 myserver.com ESMTP
C-S Command: EHLO Desarrollo
S-C Response: 250-myserver.com
C-S Command: RSET
S-C Response: 250 flushed
C-S Command: MAIL FROM: <XXXX@XXXXX.COM>
S-C Response: 250 ok
C-S Command: RCPT TO: <XXXX@XXXXX.COM>
S-C Response: 250 ok
C-S Command: RCPT TO: <XXXX@XXXXX.COM>
S-C Response: 250 ok
C-S Command: DATA
S-C Response: 354 go ahead
C-S Message Body
TCP S-C smtp>3751 [ACK] Seq=170 Ack= 1038 Win=7056 Len=0
C-S EOM:
TCP S-C smtp>3751 [ACK] Seq=170 Ack= 1043 Win=7056 Len=0
S-C Response: 250 ok 1156510725 qp27397
C-S Message Body
S-C Response: 221 myserver.com
I'm not sure why but it seems that when executing outside the IDE my
app does not issue any QUIT command. Instead it sends the server a 2nd
message body??
And what is that EOM? I haven't found any reference to it in the SMTP
RFC. Could that be the cause for the error message?
Quote

There is no way any SMTP server is going to send an "unimplemented"
error for the QUIT command. QUIT is a required command in the SMTP
protocol. Email messages cannot be sent to the specified recipients
unless the server supports the QUIT command.
I know, it is weird. After seeing the packets I have contacted my
e-mail provider on this behalf but no answer yet.
Quote

Without seeing your actual code, or the actual SMTP traffic, the only
thing I can think of is that an earlier command was sent to the
server without reading the response, so the error reply remained in
the inbound buffers until another command was sent, which in this
case happened to be the QUIT command.
Seems to me it is the case.
Just in case my code is as follows:
try
//creamos el mensaje
mensaje := TidMessage.Create;
mensaje.From.Address := WEmail;
mensaje.From.Name := WNombre;
mensaje.Subject := Asunto;
mensaje.Recipients.Add.Address := Destinatario;
mensaje.BccList.Add.Address := MyAddress;
mensaje.Body.Text := '';
TextoMensaje := TidText.Create(mensaje.MessageParts);
TextoMensaje.Body.AddStrings(Texto);
TextoMensaje.ContentType := 'text/html';
idSMTP.Connect;
try
idSMTP.Send(mensaje);
finally
idSMTP.Disconnect;
end;
finally
FreeAndNil(mensaje);
end;
Hope anyone finds sense in this...
--
Best regards :)
Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
 

Re:problem with tidSMTP after installing latest dev snapshot available (23 Aug)

"Guillem" <XXXX@XXXXX.COM>writes
Quote
done so. The results are quite strange. It is different if depending on
if I send it in or outside the IDE.
There is no difference at all in what commands get sent whether the program
is running in the IDE or not.
Quote
C-S Command: EHLO Desarrollo
S-C Response: 250-myserver.com
That is not a complete response. The '-' means that another line will
follow. The response to the EHLO command specifies all of the server's
capabilities to the client.
Quote
C-S Command: QUIT
S-C Response: 502 unimplemented (#5.5.1)
S-C Response: 221 myserver.com
The 221 is the actual response to the QUIT command. The 502 does not belong
in that conversation. Which suggests that you are connected to a buggy
server.
Quote
I'm not sure why but it seems that when executing outside the
IDE my app does not issue any QUIT command.
Yes, it does. You are receiving the 221 response for it.
Quote
Instead it sends the server a 2nd message body??
There is no way Indy can be doing that. I think you are just looking at the
Ethereal log incorrectly.
Quote
And what is that EOM?
End Of Message.
Quote
I haven't found any reference to it in the SMTP RFC.
The 'EOM' is not in the SMTP traffic itself. It is merely Ethereal's
interpretation of it for display purposes. If you look at the log deeper,
it shows the actual SMTP data for the message terminator.
Quote
Could that be the cause for the error message?
No, because Indy does not actually send 'EOM.'. It sends the real
terminator as defined in the RFC.
Quote
>Without seeing your actual code, or the actual SMTP traffic, the
>only thing I can think of is that an earlier command was sent to the
>server without reading the response, so the error reply remained in
>the inbound buffers until another command was sent, which in this
>case happened to be the QUIT command.

Seems to me it is the case.
Given the logs you have shown, that cannot be the case anymore. It now
seems that the server is sending two separate responses for a single QUIT
command, which is wrong.
Gambit
 

Re:problem with tidSMTP after installing latest dev snapshot available (23 Aug)

Remy Lebeau (TeamB) writes:
<snip answer>
thanks Remy. I will speak with my e-mail provider and will dig further to
see if I find the problema
Thanks again for your help
--
Best regards :)
Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com