docker-offlineimap/offlineimap
Łukasz Żarnowiecki 48ae1a36c8 maildir: Create top level dir recursively
This patch fixes the situation when "localfolders" specifies path that
is more that one level deep and top directory does not exists.  Example
would be "localfolders = ~/Mail/a".  This especially relevant on the
first run.

In that case we would end up with unhandled exception causing
unexpected termination of the program.

Thread 'Account sync test' terminated with exception:
Traceback (most recent call last):
  File "/offlineimap/offlineimap/threadutil.py", line 172, in run
    Thread.run(self)
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/offlineimap/offlineimap/accounts.py", line 258, in syncrunner
    self.localrepos  = Repository(self, 'local')
  File "/offlineimap/offlineimap/repository/__init__.py", line 82, in __new__
    return repo(name, account)
  File "/offlineimap/offlineimap/repository/Maildir.py", line 40, in __init__
    os.mkdir(self.root, 0o700)
OSError: [Errno 2] No such file or directory: '/Mail/a'

By replacing call to "mkdir" with "makedirs" we can simply create
directories recursively.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-01 19:49:55 +02:00
..
folder IMAP: ignore UID with 0 as value when searching for UIDs 2016-05-25 03:33:06 +02:00
repository maildir: Create top level dir recursively 2016-06-01 19:49:55 +02:00
ui Curses, UIBase: remove references to __bigversion__ 2016-03-05 06:47:24 +01:00
utils Make OS-default CA certificate file to be requested explicitely 2015-01-18 22:05:49 +03:00
__init__.py v7.0.0-rc1 2016-05-19 09:25:01 +02:00
accounts.py threading: improve variable names and factorize code 2016-05-18 04:23:02 +02:00
CustomConfig.py py3: raise exceptions using six module 2016-05-18 01:49:09 +02:00
emailutil.py Rename email.Parser to email.parser 2016-05-10 02:53:09 +02:00
error.py more consistent style 2015-01-07 21:31:43 +01:00
globals.py globals: use whitespaces instead of tabs 2016-05-22 23:31:54 +02:00
imaplib2.py bump imaplib2 from 2.52 to 2.53 2015-12-28 01:18:16 +01:00
imaplibutil.py py3: raise exceptions using six module 2016-05-18 01:49:09 +02:00
imapserver.py minor: fix copyright date 2016-05-20 18:20:07 +02:00
imaputil.py Add workaround for string.split for Python3 2016-05-10 02:53:09 +02:00
init.py threading: fix variable names about namespaces 2016-05-19 08:36:23 +02:00
localeval.py localeval: avoid redefining 'file' keyword 2015-01-14 17:18:48 +01:00
mbnames.py mbnames: add option to write the file once per account 2015-03-22 21:15:46 +01:00
threadutil.py threading: improve variable names and factorize code 2016-05-18 04:23:02 +02:00