Board index » delphi » Indy POP Client

Indy POP Client

I need to retrieve a raw message from a POP Server so I set NoDecode := true
and then use the Headers and Body properties of then new IdMessage.

But then I want Indy to decode message to get the attachments. Can I do this
without having to set NoDecode := false and reloading the message from the
server?

Thanks!

 

Re:Indy POP Client


Quote
"Juan" <gjuan3...@hotmail.com> wrote in message news:3bfc55f3_2@dnews...
> I have now version 9 but lots of errors are reported during runtime.
> For example: with RetrieveMsgSize I get "Unrecognized POP3 Response

Header:"

There is usually some additional text in the Unrecognized POP3 Response
Header.  What are you getting?  Are you calling TIdPOP3.CheckMessages before
using TIdPOP3.RetrieveMsgSize?  For example:

    iMsgCount := IdPOP31.CheckMessages;
    if iMsgCount > 0 then
    begin
      for iMsgPtr := 1 to iMsgCount do
      begin
        iMsgSize := IdPOP31.RetrieveMsgSize(iMsgPtr);
        IdPOP31.Retrieve(iMsgPtr, AMsg);
        // do something with message
      end;
      // delete messages..
    end;

Quote
> And, if I don't call RetrieveMsgSize I can't get next message header.

If you rely on RetrieveMsgSize <> 0 to indicate when you have more messages,
you'll get a protocol exception when you call RetrieveMsgSize with an
invalid message number.

I just reloaded Indy 9.0.2B from the FTP server.  It work fine using my test
bed programs.  Can you post the code that is raising the exceptions?

hth...

Re:Indy POP Client


1) There is a Bug in idPop3 line 299 (GetResponse function):

EIdException.Create(Format(RSPOP3UnrecognizedPOP3ResponseHeader,[LastCmdResu
lt.Text]))
LastCmdResult.Text is of type TStrings so this is a bug. It should be
LastCmdResult.Text.Text

Quote
> There is usually some additional text in the Unrecognized POP3 Response

2) Assuming the additional text is in LastCmdResult.Text.Text I get no
aditional text (LastCmdResult.Text.Text = '')

3) I am testing Indy 9 with the MailDemo that comes with Delphi 6. And I get
exceptions  when retriving message size. This is the original code:

  FMsgCount := POP.CheckMessages;
  FMailBoxSize := POP.RetrieveMailBoxSize div 1024;
  ....
  RetrievePOPHeaders(FMsgCount);

procedure TfrmMain.RetrievePOPHeaders(inMsgCount: Integer);
 ....
  for intIndex := 1 to inMsgCount do
  begin
    // Clear the message properties
    ShowStatus(format('Messsage %d of %d', [intIndex, inMsgCount]));
    Application.ProcessMessages;
    Msg.Clear;
    POP.RetrieveHeader(intIndex, Msg);
    // Add info to ListView
    itm := lvHeaders.Items.Add;
    itm.ImageIndex := 5;
    itm.Caption := Msg.Subject;
    itm.SubItems.Add(Msg.From.Text);
    itm.SubItems.Add(DateToStr(Msg.Date));
    itm.SubItems.Add(IntToStr(POP.RetrieveMsgSize(intIndex)));   <<<<<<<<<
EXCEPTION HERE
end

Thanks again,
Juan

Re:Indy POP Client


4) SaveToStream does not work. The stream is empty when the method ends.
Even with Indy9 patch1 applied.

Lots and lots of errors!

Re:Indy POP Client


Quote
"Juan" <gjuan3...@hotmail.com> wrote in message news:3bfd294e_2@dnews...
> > There is usually some additional text in the Unrecognized POP3 Response
> 1) There is a Bug in idPop3 line 299 (GetResponse function):

EIdException.Create(Format(RSPOP3UnrecognizedPOP3ResponseHeader,[LastCmdResu

Quote
> lt.Text]))
> LastCmdResult.Text is of type TStrings so this is a bug. It should be
> LastCmdResult.Text.Text

Good catch.  It's cruel when the exception handler raises an exception. <g>
I've fixed this, and checked it in.

Quote
> 2) Assuming the additional text is in LastCmdResult.Text.Text I get no
> aditional text (LastCmdResult.Text.Text = '')

Ok.  This indicates that the POP3 server you're connecting to  is issuing a
response other than '+OK' or '-ERR'.   Could you add a TIdLogEvent or
TIdLogFile to capture the output from the server?  It sounds like its
sending a bad response message.

Quote
> 3) I am testing Indy 9 with the MailDemo that comes with Delphi 6. And I
get
> exceptions  when retriving message size. This is the original code:

I just tested this using my POP3 server.  No exception.

hth...

Re:Indy POP Client


Don,

Have you seen my post about the idmessage boundries ?

If I load an IdMessage with raw data and then send it as pop3 all boundries
around attachments are like
IndyMultiPartAlternativeBoundry or IndyMultiPartRelatedBoundy. OE has
different boundries around each attachment.

Can you explain ?

Rgds,
Ewart

Re:Indy POP Client


"Don Siders - Team Indy" <side...@att.net> wrote in message
news:3bfd4e4f$1_2@dnews...

Quote

> Ok.  This indicates that the POP3 server you're connecting to  is issuing
a
> response other than '+OK' or '-ERR'.   Could you add a TIdLogEvent or
> TIdLogFile to capture the output from the server?  It sounds like its
> sending a bad response message.

How would i do that Don, i've read up and down and left and right but for
the love of it i can't find a single way to get those log component to do
anything at all.

Other Threads