-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to create 'directory' error #413
Comments
Actually, I'm surprised this configuration worked before v7.0.10:
Here, you're telling offlineimap to not sync "[Gmail]/All Mail" and to translate any other folder name to 'INBOX'. This is good news that the latest version is complaining. |
Well, I am confused then. The following seems to indicate that offlineimap will do exactly what I am requesting: copy the '[Gmail]/All Mail' folder to the INBOX folder on the other IMAP server. So, I am curious what I am doing wrong when I try to do that. $ offlineimap --info folderfilter= lambda folder: folder.startswith('[Gmail]/All Mail') nametrans= lambda folder: 'INBOX' Folderlist: Local repository 'NSOIMAP': type 'MappedIMAP' Folderlist: |
My bad, this nametrans makes sense when all the folders are filtered but one. |
@aroig you were right about the wrong use of remote names while comparing structures. The translations are currently broken. Hence, v7.0.10 is broken for some users. The reason is that we blindly assume that |
481efa9 is wrong to assume the local nametrans is set up and working. Now, we correctly check that the local folder name is the same once both nametrans are applied to itself. This check is only done when we have to create the folder on remote. Github-ref: OfflineIMAP#413 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
I think I've fixed all known issues with this patch: nicolas33@6b6fa4f |
EDIT 2: Yes. The patch fixed the issue for me. EDIT 1: Duh - please ignore the below. I am recompiling with the correct branch. Sorry to disappoint, I am still getting the error. I checked out branch b367, compiled and ran. gitk shows your patch. The error seems to be that, for whatever reason, on the non-Google account offlineimap wants to create the 'INBOX' folder, that of course already exists... Error is very similar: $ offlineimap Traceback: ERROR: Folder 'INBOX'[MyIMAP] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists']) Traceback: |
@nicolas33 nicolas33/offlineimap@6b6fa4f looks good. I've tested it with local nametrans and no problems there. Right now it is a pain to test it without local nametrans because of the fmd5 issue... so I have not tested it that way. |
@Blind55 I still don't get why it fails for you with nicolas33@6b6fa4f. The offending check is For whatever reason, local_name is not |
@aroig Are you saying that migrating from v7.0.9 to nicolas33@6b6fa4f implies FMD5 changes? Or you didn't try because of the previous issues you had with FMD5? |
@nicolas33 @Blind55 is saying that nicolas33/offlineimap@6b6fa4f indeed works for him in an edit to his message.
No no. As far as I can see nicolas33/offlineimap@6b6fa4f is very ok. I'm testing directly with all my email. Because of the issues the other day, I added a local nametrans, which invalidated all uids in my email because of the md5. Then I fixed the fmd5 manually for all 200k messages in my local mailbox. Now I'm stuck with the local nametrans. If I want to test without it, either I should rename the files again, or setup a testing mailbox, which would be a prudent thing to do anyways... ;) I haven't done that. |
Alright! I've read the message the other way around.
Yes, this is what I do too. However, I've put the maildirs and offlineimap cache into a filesystem supporting snapshots (btrfs) to revert from issues easily. On top of this I have a testing account.
Hmm... The FMD5 is built from the translated local name! Ok. I understand more of #411. :-) Thanks both for your feedback! |
481efa9 is wrong to assume the local nametrans is set up and working. Now, we correctly check that the local folder name is the same once both nametrans are applied to itself. This check is only done when we have to create the folder on remote. Github-ref: #413 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
General informations
offlineimap -V
): offlineimap v7.0.10, imaplib2 v2.55 (bundled), Python v2.7.12Configuration file offlineimaprc
[general]
accounts = main
[Account main]
remoterepository = GMail
localrepository = MyIMAP
[Repository MyIMAP]
type = IMAP
remotehost = imap.somewhere.com
remoteuser = me
remotepass = notyou
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
[Repository GMail]
type = Gmail
remoteuser = me@gmail.com
remotepass = notyou
auth_mechanisms = PLAIN
nametrans = lambda folder: 'INBOX'
folderfilter = lambda folder: folder.startswith('[Gmail]/All Mail')
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
Logs, error
$ offlineimap
OfflineIMAP 7.0.10
Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync main:
*** Processing account main
Establishing connection to imap.gmail.com:993 (GMail)
Establishing connection to imap.somewhere.com:993 (MyIMAP)
Creating folder INBOX[MyIMAP]
ERROR: Creating folder INBOX on repository MyIMAP
Folder 'INBOX'[MyIMAP] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists'])
ERROR: Folder 'INBOX'[MyIMAP] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists'])
*** Finished account 'main' in 0:12
ERROR: Exceptions occurred during the run!
ERROR: Creating folder INBOX on repository MyIMAP
Folder 'INBOX'[MyIMAP] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists'])
Traceback:
File "/usr/lib/python2.7/site-packages/offlineimap/repository/Base.py", line 267, in sync_folder_structure
local_repo.makefolder(local_name)
File "/usr/lib/python2.7/site-packages/offlineimap/repository/IMAP.py", line 551, in makefolder
OfflineImapError.ERROR.FOLDER)
ERROR: Folder 'INBOX'[MyIMAP] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox already exists'])
Traceback:
File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line 278, in syncrunner
self.__sync()
File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line 344, in __sync
remoterepos.sync_folder_structure(localrepos, statusrepos)
File "/usr/lib/python2.7/site-packages/offlineimap/repository/Base.py", line 267, in sync_folder_structure
local_repo.makefolder(local_name)
File "/usr/lib/python2.7/site-packages/offlineimap/repository/IMAP.py", line 551, in makefolder
OfflineImapError.ERROR.FOLDER)
Steps to reproduce the error
This setup ran fine with 7.0.9.
If I run the program as outlined above, I now get the error about INBOX already existing in MyIMAP.
The text was updated successfully, but these errors were encountered: