VMM/mailbox: Decode error messages from doveadm.
Those errors occur only with the dbox mailbox format when the
mailbox.folders contains non-ASCII mailbox names.
--- a/VirtualMailManager/mailbox.py Mon Dec 03 19:19:52 2012 +0000
+++ b/VirtualMailManager/mailbox.py Sat Dec 08 14:48:30 2012 +0000
@@ -14,6 +14,7 @@
from binascii import a2b_base64, b2a_base64
from subprocess import Popen, PIPE
+from VirtualMailManager import ENCODING
from VirtualMailManager.account import Account
from VirtualMailManager.common import lisdir
from VirtualMailManager.errors import VMMError
@@ -257,7 +258,7 @@
stderr = process.communicate()[1]
if process.returncode:
e_msg = _('Failed to create mailboxes: %r\n') % mailboxes
- raise VMMError(e_msg + stderr.strip().decode(), VMM_ERROR)
+ raise VMMError(e_msg + stderr.strip().decode(ENCODING), VMM_ERROR)
def create(self):
"""Create a dbox INBOX"""