Issue with \Noselect
Hi! There's a folder in a test mailbox that has \Noselect flag. This causes imapsync to fail the migration:
++++ Listing 3 errors encountered during the sync ( avoid this listing with --noerrorsdump ). Err 1/3: Host1 Folder 123456: Could not select: 30 NO Mailbox does not exist Err 2/3: Host1 folder 123456: Could not select: 69 NO Mailbox does not exist Err 3/3: Host1 Folder 123456: Could not select: 137 NO Mailbox does not exist Exiting with return value 111
Listing the folders, this is what we have:
`* LIST (\HasChildren \Noselect) "." "123456"
- LIST (\HasNoChildren) "." "123456.54321"
- LIST (\HasNoChildren) "." "123456.78910"`
How to handle those folders and have a successful migration? Thanks!
Hi! Well, the strange thing here is that by default, imapsync does a tour on all requested folders, all folders by default, and check whether they can be selected or not. If a folder can't be selected, it has the \Noselect flag set, then imapsync removed it from the list of folders to be synced.
So several possibilities:
- A bug from an Perl module Mail::IMAPClient prior to 3.36. It used to be wrong about the function $imap->selectable( folder ) used by imapsync to detect selectability https://metacpan.org/changes/distribution/Mail-IMAPClient
version 3.36: Fri Aug 14 01:40:50 UTC 2015
- rt.cpan.org#91912: selectable broke in 3.29 due to \b around \NoSelect
[Justin Vallon, Gilles Lamiral]
- You use option
--nocheckselectableand imapsync fails on it. I would say the error is then attended.
Solution to handle this "Could not select" error: avoid this folder with
imapsync ... --exclude 123456
Or, if you still want the children folders,
-
on Windows:
imapsync ... --exclude "^123456$" -
on Unix/Linux/Mac:
imapsync ... --exclude '^123456$'
No news. Closing.
Hi, I'm experiencying the same problem:
Err 1/50: Host1 folder "path/of/folder": Could not select: 1040 NO ""path/of/folder"" doesn't exist.
imapsync 1.882 on ubuntu 16.04.6 LTS.
Sync is done from MS Exchange to Zimbra. Mail::IMAPClient (3.42).
No option --nocheckselectable used.
What are those double-double quotes?
NO ""path/of/folder""
I changed the path but the "" are as reported in the error.
BTW, it seems like to error is caused by a backslash \ character in a folder name.
Running imapsync with --exclude '\\' seems to work with no errors.
I wonder if it will give the same error when encountering one of these characters:
~ ! @ # $ % ^ & * ( ) _ + = { } | [ ] \ : ” ; ‘ < > , . ? /
I see some folder's name with parenthesis ().
I'll report back if I'll get the same error with other folders.
Hi! Mail::IMAPClient 3.42 is ok but imapsync 1.882 is quite old to be the one I fine to debug, I prefer debug late releases. The two characters \ and ( are special in Perl and IMAP so well, we might be on a bug here. Next time, make a run with --debugimap
No news. Closing again.
I had this issue too, and wanted to share the solution here.
I got this error message:
Listing 18 errors encountered during the sync ( avoid this listing with --noerrorsdump ).
Err 1/18: Host1 Folder INBOX: Could not select: 16 NO [SERVERBUG] Internal error occurred. Refer to server log for more information. [2024-03-05 00:07:29] (0.000 + 0.000 secs).
Err 2/18: Host1 Folder INBOX.Archive: Could not select: 17 NO Mailbox doesn't exist: INBOX.Archive (0.000 + 0.000 secs).
Err 3/18: Host1 Folder INBOX.Drafts: Could not select: 18 NO Mailbox doesn't exist: INBOX.Drafts (0.000 + 0.000 secs).
Err 4/18: Host1 Folder INBOX.Junk: Could not select: 19 NO Mailbox doesn't exist: INBOX.Junk (0.000 + 0.000 secs).
Err 5/18: Host1 Folder INBOX.Sent: Could not select: 20 NO Mailbox doesn't exist: INBOX.Sent (0.000 + 0.000 secs).
Err 6/18: Host1 Folder INBOX.Trash: Could not select: 21 NO Mailbox doesn't exist: INBOX.Trash (0.000 + 0.000 secs).
Err 7/18: Host1 folder INBOX: Could not select: 22 NO Mailbox doesn't exist: INBOX (0.000 + 0.000 secs).
Err 8/18: Host1 folder INBOX.Archive: Could not select: 23 NO Mailbox doesn't exist: INBOX.Archive (0.000 + 0.000 secs).
Err 9/18: Host1 folder INBOX.Drafts: Could not select: 24 NO Mailbox doesn't exist: INBOX.Drafts (0.000 + 0.000 secs).
Err 10/18: Host1 folder INBOX.Junk: Could not select: 25 NO Mailbox doesn't exist: INBOX.Junk (0.000 + 0.000 secs).
Err 11/18: Host1 folder INBOX.Sent: Could not select: 26 NO Mailbox doesn't exist: INBOX.Sent (0.000 + 0.000 secs).
Err 12/18: Host1 folder INBOX.Trash: Could not select: 27 NO Mailbox doesn't exist: INBOX.Trash (0.000 + 0.000 secs).
Err 13/18: Host1 Folder INBOX: Could not select: 28 NO Mailbox doesn't exist: INBOX (0.000 + 0.000 secs).
Err 14/18: Host1 Folder INBOX.Archive: Could not select: 29 NO Mailbox doesn't exist: INBOX.Archive (0.000 + 0.000 secs).
Err 15/18: Host1 Folder INBOX.Drafts: Could not select: 30 NO Mailbox doesn't exist: INBOX.Drafts (0.000 + 0.000 secs).
Err 16/18: Host1 Folder INBOX.Junk: Could not select: 31 NO Mailbox doesn't exist: INBOX.Junk (0.000 + 0.000 secs).
Err 17/18: Host1 Folder INBOX.Sent: Could not select: 32 NO Mailbox doesn't exist: INBOX.Sent (0.000 + 0.000 secs).
Err 18/18: Host1 Folder INBOX.Trash: Could not select: 33 NO Mailbox doesn't exist: INBOX.Trash (0.000 + 0.000 secs).
And this is the imapsync command I used:
imapsync \
--host1 host1.email.au --port1 143 --tls1 \
--user1 "[email protected]" \
--password1 password1 \
--host2 host2.email.au --port2 143 --tls2 \
--user2 "[email protected]" \
--authuser2 admin --password2 password2 \
--automap \
--delete2duplicates \
--debug \
--dry
This happened because I use a master user to transfer the mailboxes, and the master user does not have access to the user's mailboxes. The solution is to modify the dovecot config and add these 2 lines:
plugin {
# lines of the existing plugin block
...
acl_user=%u
master_user=%u
}
Save the changes, and validate the config with this command:
doveconf >/dev/null && echo OK
If it returns no error or warning messages, restart the dovecot service. You should be able to proceed after that.
For more information check this out: https://doc.dovecot.org/configuration_manual/authentication/master_users/#acls
Hope this helps.
@budiantoip had the same problem with dovecot (master user) and your fix helped! thanks ;)
@budiantoip had the same problem with dovecot (master user) and your fix helped! thanks ;)
What fix?
i had to adjust my dovecot config:
plugin {
# lines of the existing plugin block
...
acl_user=%u
master_user=%u
}
Then login via super master / admin user was possible for imapsync ;)
At 2025 this save me, thanks, the problem was masteruser has no access permission to INBOX
Okay, I leave this issue Open for eternity :-)