IdPOP3 and error Max line length exceeded.

Giganews Newsgroups
Subject: IdPOP3 and error Max line length exceeded.
Posted by:  Mirko Boeer (newsgrou…@wt-rate.com)
Date: Mon, 27 Jun 2005

Hi,

I use the DevSnapshot and get the error "Max line length exceeded." while
retrieving the welcome email from a web.de account. The line length is
greater then the defined IdMaxLineLengthDefault = 16 * 1024, this value
should be greater e.g. 64K.

Also in IdPOP3.pas is an error, the function RetrieveMsgSize is not  correct

function TIdPOP3.RetrieveMsgSize(const MsgNum: Integer): Integer;
var
  s: string;
begin
  // Returns the size of the message. if an error ocurrs, returns -1.
  SendCmd('LIST ' + Sys.IntToStr(MsgNum), ST_OK);    {Do not Localize}
  // RL - ignore the message number, grab just the octets,
  // and ignore everything else that may be present
  Fetch(s);
  Result := Sys.StrToInt(Fetch(s), -1);
end;

Correct should be this function

function TIdPOP3.RetrieveMsgSize(const MsgNum: Integer): Integer;
var
  s: string;
begin
  Result := -1;
  // Returns the size of the message. if an error ocurrs, returns -1.
  SendCmd('LIST ' + Sys.IntToStr(MsgNum), ST_OK);    {Do not Localize}

  s := LastCmdResult.Text[0];
  if Length(s) > 0 then begin
    // RL - ignore the message number, grab just the octets,
    // and ignore everything else that may be present
    Fetch(s);
    Result := Sys.StrToInt(Fetch(s), -1);
  end;
end;

--
mirko

newsgrou…@wt-rate.com (email address is disabled!)

http://www.wt-rate.com/prglist.htm

Replies