My goal is to copy the whole folder structure with all mails from one imap account to another. The tool I am using for this is imapcopy (the java based version from code.google.com since the unix/linux tool packaged with debian doesn't support imaps).

Now, there is one problem: The tool only copies the top-level folders and not the nested ones. To narrow down the problem I have downloaded the source code of imapcopy and debugged into the code. There I noticed that the folder.list() (which is mapped to the list "%" imap command) returns an empty list. But when I do a getFolder(<subfoldername>) I can access those subfolders. After reading some documentation about the features of imap I think that the problem might be some misconfigured ACLs which prohibit the listing of those folders but allow to read ad write to them.

How should I check this ACLs? which tools do I need for this task?

1 Answer 1


I found the solution by myself: It seems that calling open() for a particular folder results in an empty list of subfolders for the same folder. By moving the line calling list() before the line calling open(), imapcopy works as expected. I also appended my changed java code to the already existing issue ticket at the imapcopy project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.