Bug? TIdPop3 gets unstable if error in attachement-decoding occurs

Giganews Newsgroups
Subject: Bug? TIdPop3 gets unstable if error in attachement-decoding occurs
Posted by:  Thomas (Thom…@gmx.de)
Date: Wed, 8 Jun 2005

Hello,
sometimes i get EMails where an error occurs during attachment-decoding
(uneven size in decodetoStream).
After this error i cant receive any further emails.
I found the problem in IdMessageClient.pas --> ReceiveBody.
If ProcessAttachment raises an error, the buffer with the email-data is not
cleared and
all following actions will fail.

I changed this lines:
              mcptAttachment:
              begin
                  LActiveDecoder := ProcessAttachment(LActiveDecoder);
              end;
to:
              mcptAttachment:
              begin
                try
                  LActiveDecoder := ProcessAttachment(LActiveDecoder);
                except
                  InputBuffer.Remove(InputBuffer.Size);
                  raise;
                end;
              end;

This works for all my emails.

Replies