From 8ea423173cba143f68a94d65ad5f3b5ce650d434 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Sat, 14 Sep 2013 17:09:01 +0200 Subject: [PATCH] Check the container, not the leaf :p see #482 --- .../admin/management/commands/handle_mailbox_operations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modoboa/admin/management/commands/handle_mailbox_operations.py b/modoboa/admin/management/commands/handle_mailbox_operations.py index e4da2cb36..663bf3919 100644 --- a/modoboa/admin/management/commands/handle_mailbox_operations.py +++ b/modoboa/admin/management/commands/handle_mailbox_operations.py @@ -25,9 +25,10 @@ class Command(BaseCommand): if not os.path.exists(operation.argument): return new_mail_home = operation.mailbox.mail_home - if not os.path.exists(new_mail_home): + dirname = os.path.dirname(new_mail_home) + if not os.path.exists(dirname): try: - os.makedirs(os.path.dirname(new_mail_home)) + os.makedirs(dirname) except os.error as e: raise OperationError(str(e)) code, output = exec_cmd(