Re: TIDPOP3Server attachment problem

Giganews Newsgroups
Subject: Re: TIDPOP3Server attachment problem
Posted by:  Ciaran Costelloe (ccostell…@flogas.ie)
Date: Thu, 28 Aug 2003

Hi Philip.

"Philip Taylor" <philly_t…@hotmail.com> wrote in message
news:E5ED2F4DB17CE240philly_t…@hotmail.com...
> Hi,
>
> I have a program that downloads mail from a pop3 server (ISP), stores them
> on disk as IDMessages, then passes them on to outlook express when it
> connects to the IDPOP3Server.
>
> Everything seems to work fine, except that OE does not pick up that an
> e-mail has an attachment. The message source of the e-mail appears to
> contain the attachment, howver:
>
> --=_NextPart_2rfkindysadvnqw3nerasdf
> Content-Type: image/jpeg; name="31.jpg";
>        name="31.jpg"
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename="31.jpg";
>        filename="31.jpg"
>
> /9j/4AAQSkZJRgABAgA... etc.

I cannot help with the POPServer bit, but I may be able to verify the copy
written to disk.  I am not sure what you mean by "message source".  Can you
post the FULL file written to disk, just omitting the middle encoded lines
(the "/9j/4AAQSkZJRgABAgA." ones) ?

Ciaran

> My question is, how do i pass the e-mails onto OE so that the attachment
> will be 'detected'?
> Heres me code as it stands:
>
> //client
> procedure TForm1.Button1Click(Sender: TObject);
> var
>    i : integer;
> begin
>    idpop31.Connect(10000);
>    messagesonserver := idpop31.Checkmessages; // get total messages on
ISP
>
>    if messagesonserver > 0 then  // if there are messages
>    begin
>        for i := 1 to messagesonserver do
>        begin
>            IDPop31.Retrieve(i, IDMessage1); // download message, store in
> idmessage1
>            IDMessage1.SaveToFile(inttostr(messagecount) + '.mail',
false);
> // save message to disk
>            // Store filename of message for later retrieval
>            Messages.Append(inttostr(messagecount) + '.ppsf,' +
> inttostr(IDMessage1.InstanceSize));
>            inc(messagecount); // Add one to number of messages in
database
>        end;
>    end;
>    idpop31.Disconnect;
> end;
>
> //server
> procedure TForm1.IdPOP3Server1RETR(ASender: TIdCommand;
>  AMessageNum: Integer);
> var
>    aStringList : TStringlist;
> begin
>
> // <<<<<<<<<<  HERES WHERE I GET STUCK >>>>>>>>>>>
>
>    aStringList := Tstringlist.Create; // create stringlist
>    aStringList .LoadFromFile(inttostr(AMessageNum - 1) + '.mail'); //
load
> IDMessage into stringlist
>    ASender.Response.Add('+OK ' + inttostr(sizeof(aStringList )) + '
> octets'); // send msg num and size
>    Asender.Response.AddStrings(aStringList ); // send message
>    FreeandNil(aStringList ); // free stringlist
> end;
>
> Thanks for your help,
>
> Philip

Replies

In response to

TIDPOP3Server attachment problem posted by Philip Taylor on Thu, 28 Aug 2003