VMM/account: Fixed account's transport check.
authorPascal Volk <user@localhost.localdomain.org>
Sat, 15 Sep 2012 17:31:34 +0000
changeset 613 7b3494f1a2ef
parent 612 924535664ecc
child 614 1ec3497a6733
VMM/account: Fixed account's transport check. Make sure that 'virtual:' isn't used as transport when the mailbox-format is set to mdbox or sdbox.
VirtualMailManager/account.py
--- a/VirtualMailManager/account.py	Wed Sep 12 19:19:05 2012 +0000
+++ b/VirtualMailManager/account.py	Sat Sep 15 17:31:34 2012 +0000
@@ -124,11 +124,12 @@
                        'mbfmt': maillocation.mbformat,
                        'version': version_str(maillocation.dovecot_version)},
                        INVALID_MAIL_LOCATION)
-        if self._transport and not maillocation.postfix and \
-          self._transport.transport.lower() in ('virtual:', 'virtual'):
+        transport = self._transport or self._domain.transport
+        if not maillocation.postfix and \
+          transport.transport.lower() in ('virtual:', 'virtual'):
             raise AErr(_(u"Invalid transport '%(transport)s' for mailbox "
                          u"format '%(mbfmt)s'.") %
-                       {'transport': self._transport,
+                       {'transport': transport,
                         'mbfmt': maillocation.mbformat}, INVALID_MAIL_LOCATION)
         self._mail = maillocation
         self._set_uid()