Archived Forum Post

Index of archived forum posts


IMAP Mail Copy Error

Nov 12 '12 at 03:36

I want to copy a mail via IMAP into an other folder - VB.ActiveX Code and ErrorLog see below:

'  Copy to a folder named "Gelöschte Elemente"
success = imap.Copy(Email.GetImapUid, 1, "Gelöschte Elemente")

    DllDate: Aug  5 2012
    Username: PC47052:adbm
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    mailbox: Gelöschte Elemente
    utf7EncodedMailboxName: Gel&APY-schte Elemente
    Command: aaag UID COPY -1 "Gel&APY-schte Elemente"
    ImapCmdSent: aaag UID COPY -1 "Gel&APY-schte Elemente"
      ImapCmdResp: aaag BAD The specified message set is invalid.
    Failed to find OK line in response.
    imapCopyResponse: aaag BAD The specified message set is invalid.

With Release 9.3.0 it worked well; with 9.3.2 I get the obove error. (The National Character "ö" in the folder name seems to make a problem.)


The problem shouldn't be the character "ö".

I noticed that the integer value -1 is used for the UID in the COPY command sent to IMAP, which tells me that the call to Email.GetImapUid must have returned -1. The problem is not with the Copy method, but with the GetImapUid method.

As an aside, if a Chilkat method can return a value indicating failure, such as -1, false, NULL, etc., then it's not a good idea to insert the method call directly into the argument list of another method call. It's better to make the call on a separate line and check for the error condition. For example:

uid = email.GetImapUid()
if (uid = -1) then
success = imap.Copy(uid, 1, "Gelöschte Elemente") endif

If the GetImapUid method returns -1, it means the "ckx-imap-uid" header field was not present. If the FetchSingle method was called to download the email, see this Chilkat Forum topic for more information about it:


Thanks for your hints (I use fetchbundle); the answer in
solved my problem.