summaryrefslogtreecommitdiffstats
path: root/pykolab/cli/cmd_transfer_mailbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/cli/cmd_transfer_mailbox.py')
-rw-r--r--pykolab/cli/cmd_transfer_mailbox.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pykolab/cli/cmd_transfer_mailbox.py b/pykolab/cli/cmd_transfer_mailbox.py
index 4a4069a..cef9ec1 100644
--- a/pykolab/cli/cmd_transfer_mailbox.py
+++ b/pykolab/cli/cmd_transfer_mailbox.py
@@ -55,13 +55,13 @@ def execute(*args, **kw):
domain = mbox_parts['domain']
user_identifier = "%s@%s" % (mbox_parts['path_parts'][1], mbox_parts['domain'])
- source_server = imap.user_mailbox_server(mailfolder)
- imap.connect(server=source_server)
- imap.imap.xfer(mailfolder, target_server)
-
- auth = Auth()
+ auth = Auth(domain=domain)
auth.connect()
user = auth.find_recipient(user_identifier)
+ source_server = imap.user_mailbox_server(mailfolder)
+ imap.connect(server=source_server)
+ imap.imap.xfer(mailfolder, target_server)
+
auth.set_entry_attributes(domain, user, {'mailhost': target_server})