Page MenuHomePhorge

problem with creating user mailbox
Closed, ResolvedPublic

Description

pykolab.log:

2021-05-20 21:58:38,304 pykolab.imap ERROR [2066] Could not create folder 'user/@'
2021-05-20 21:58:39,371 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:58:39,378 pykolab.imap ERROR [2066] Could not create the mailbox for user @, aborting.
2021-05-20 21:58:39,378 pykolab.auth ERROR [2066] An error occured using _paged_search: AttributeError("'bool' object has no attribute 'lower'",)
2021-05-20 21:58:39,379 pykolab.auth ERROR [2066] Traceback (most recent call last):

File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 3200, in _search
  secondary_domains
File "<string>", line 10, in <module>
File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2964, in _paged_search
  callback(entry=_result_data)
File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2795, in _synchronize_callback
  eval("self._change_none_%s(entry, None)" % (entry['type']))
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/pykolab/auth/ldap/__init__.py", line 2319, in _change_none_user
  server = self.imap.user_mailbox_server(folder)
File "/usr/lib/python2.7/site-packages/pykolab/imap/__init__.py", line 861, in user_mailbox_server
  server = self.imap.find_mailfolder_server(mailbox.lower()).lower()

AttributeError: 'bool' object has no attribute 'lower'

2021-05-20 21:58:55,298 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:59:01,834 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:59:02,275 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:59:06,035 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:59:07,576 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:59:19,440 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults
2021-05-20 21:59:30,176 pykolab.conf WARNING [1549] Option ldap/timeout does not exist in config file /etc/kolab/kolab.conf, pulling from defaults

[root@mail ~]# rpm -qv pykolab
pykolab-0.8.19-1.9.el7.kolab_16.noarch

Details

Ticket Type
Task

Event Timeline

sicherha subscribed.

According to the log, the script tries to create a user named '@'. That's, well, weird. Unfortunately, I'm not sufficiently familiar with the pykolab codebase to make a qualified guess where this username may have originated from.

What I can tell is that the return-value handling for imap.user_mailbox_create() smells fishy. ldap._change_none_user() calls imap.user_mailbox_create() and passes its return value as argument to imap.user_mailbox_server(). It expects that value to be of type str, but imap.user_mailbox_create() may return the bool value False on error! That type mixup is why the whole script goes down in flames.

D3692 and D3710 should fix this
I ran into same error, when testing for Python 3

imap.user_mailbox_create() always returns a string, so this should be fine. Is there a command-line way to reproduce this issue?

machniak lowered the priority of this task from Needs Triage to Normal.Sep 27 2023, 11:18 AM
machniak subscribed.

@mollekopf, imap.user_mailbox_create() returns False on error.