Skip to content
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

Folder names including forward slash cause ERROR: getfolder() asked for a nonexisting folder #705

Open
JonathanH-UK opened this issue Sep 30, 2021 · 1 comment

Comments

@JonathanH-UK
Copy link

General informations

  • system/distribution (with version): Ubuntu 20.04
  • offlineimap version (offlineimap -V): offlineimap v7.1.1, imaplib2 v2.57 (system), Python v2.7.18, OpenSSL 1.1.1f 31 Mar 2020
  • Python version: Python v2.7.18
  • server name or domain: mail.livemail.co.uk
  • CLI options: -1

Configuration file offlineimaprc

[general]
accounts = XYZ

[Account XYZ]
localrepository = XYZLocal
remoterepository = XYZRemote

[Repository XYZLocal]
type = Maildir
localfolders = ~/Email/XYZ_Backup

[Repository XYZRemote]
type = IMAP
remotehost = mail.livemail.co.uk
remoteuser = info@#####.org.uk
sslcacertfile = OS-DEFAULT

pythonfile (if any)

N/A

Logs, error

 Syncing Brokerage~Jane Doe : IMAP -> Maildir
 ERROR: getfolder() asked for a nonexisting folder 'Brokerage.John Doe/BREAKME'.
 *** Finished account 'XYZ' in 0:08
 ERROR: Exceptions occurred during the run!
 ERROR: getfolder() asked for a nonexisting folder 'Brokerage.John Doe/BREAKME'.
 
Traceback:
  File "/home/jonathan/Source_Code/offlineimap/offlineimap/accounts.py", line 281, in syncrunner
    self.__sync()
  File "/home/jonathan/Source_Code/offlineimap/offlineimap/accounts.py", line 378, in __sync
    localfolder = self.get_local_folder(remotefolder)
  File "/home/jonathan/Source_Code/offlineimap/offlineimap/accounts.py", line 310, in get_local_folder
    replace(self.remoterepos.getsep(), self.localrepos.getsep()))
  File "/home/jonathan/Source_Code/offlineimap/offlineimap/repository/Maildir.py", line 149, in getfolder
    "folder '%s'."% foldername, OfflineImapError.ERROR.FOLDER)

Steps to reproduce the error

  • Create a mail subfolder - e.g. Brokerage and then a folder under that such as 'Something/Else'
  • Try to sync this IMAP account using offlineimap
  • Under the backup directory the folders get created as
BackupDir
 |_ Brokerage.Something
   |_ Else
  • When the sync takes place it is looking for a correctly escaped directory name called exacty Brokerage.Something/Else which does not exist.
  • offlineimapsync Crashes and Burns :-(

Workaround

  • Rename IMAP folder so it doesn't contain a slash in the name
@nicolas33
Copy link
Member

I wonder the server is not providing the correct separator character.

Sadly, --info does not give info about this. This might worth adding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants