Moving message from POP to IMAP

Giganews Newsgroups
Subject: Moving message from POP to IMAP
Posted by:  Valdir (ogecr…@gmail.com)
Date: Fri, 17 Apr 2009

Hi,

I'm trying to move a message from a pop3 account to another server imap4
account using the following code snippet and Indy 10.2.3.
But on the target imap account the messages without attachments appear
with a CRLF . CRLF at the end of the message.
And the messages with attachments appear blank. I am using outlook express
to check the results on the target server.
If I use the same account, on the same server, read from pop and write to
IMAP, I got the same results. And on each try the message appear with more
dots. For example, 3 tries, the end of the message looks like this:

....

...

..

Here is the code snippet.

pop.Retrieve(i, Msg);
if imap.SelectMailBox('INBOX') then
begin
  imap.AppendMsg('INBOX', Msg, Msg.Flags);
  pop.Delete(i);

Am I missing something?

Thanks in advance for you attention.

Replies