manusa / mnIMAPSync

Java IMAP email syncing tool
Apache License 2.0
39 stars 13 forks source link

Gmail (destination), can't create trash folder #5

Open virgolamobile opened 9 years ago

virgolamobile commented 9 years ago

java -jar mnIMAPSync.jar --host1 imap.gmail.com --port1 993 --user1 XXXXXXXX@gmail.com --password1 ZZZZZZZZ --ssl1 --host2 imap.gmail.com --port2 993 --user2 KKKKKKKK@gmail.com --password2 ZZZZZZZZ --ssl2

Indexed (target): 0/0 Copied: 0/0 Deleted: 0/0 Speed: 0,00 m/s

Indexed (target): 0/0 Copied: 0/0 Deleted: 0/0 Speed: 0,00 m/sgen 19, 2015 7:13:45 PM com.marcnuri.mnimapsync.store.StoreCopier copy SEVERE: null javax.mail.MessagingException: Couldn't create folder: Trash in target server. at com.marcnuri.mnimapsync.store.StoreCopier.copySourceFolder(StoreCopier.java:118) at com.marcnuri.mnimapsync.store.StoreCopier.copySourceFolder(StoreCopier.java:128) at com.marcnuri.mnimapsync.store.StoreCopier.copy(StoreCopier.java:88) at com.marcnuri.mnimapsync.MNIMAPSync.sync(MNIMAPSync.java:94) at com.marcnuri.mnimapsync.MNIMAPSync.main(MNIMAPSync.java:147)

Sync Process Finished.

Folders copied: 0/265 Messages copied: 0/0 Speed: 0,00 m/s Exceptions: false Elapsed time: 90 s

manusa commented 9 years ago

GMail has some special conditions for IMAP access.

GMail labels are shown as virtual folders when accessed by IMAP, the same happens with "Trash","Spam"... You can configure if these labels are shown as IMAP folders or hidden in GMail settings in the Labels tab.

The error message says that it can't create Trash folder in target server (this is normal because it's a protected folder/label), but this folder should already be there. Try to access the target server with a regular IMAP client and make sure there's nothing wrong, also check label settings in GMail.

Re-run the process and see what happens.

virgolamobile commented 9 years ago

First of all, thank you for your reply. As a developer this is important.

I will try switching label visibility.

I opened this issue because mnIMAPSync exit with exceptions, and doesn't try to use (or ignore) existent default trash folder.

Thank you, n

Concept211 commented 9 years ago

I'm having a similar issue where the source server's inbox is labeled "INBOX" but the destination server 's inbox is labeled "Inbox". So it crashes because it's trying to create a new folder. Anyway of changing the code so that it's case-insensitive?

Indexed (target): 0/0 Copied: 0/0 Deleted: 0/0 Speed: 0.00 m/sApr 10, 2015 11:0 9:36 AM com.marcnuri.mnimapsync.store.StoreCopier copy SEVERE: null javax.mail.MessagingException: Couldn't create folder: INBOX in target server. at com.marcnuri.mnimapsync.store.StoreCopier.copySourceFolder(StoreCopie r.java:118) at com.marcnuri.mnimapsync.store.StoreCopier.copySourceFolder(StoreCopie r.java:128) at com.marcnuri.mnimapsync.store.StoreCopier.copy(StoreCopier.java:88) at com.marcnuri.mnimapsync.MNIMAPSync.sync(MNIMAPSync.java:94) at com.marcnuri.mnimapsync.MNIMAPSync.main(MNIMAPSync.java:147)

Note: I'm trying to copy from hMailServer to SmarterMail.