1

Topic: Cannot use Export all managed accounts from panel v 4.0

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: CentOS 6.8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I use "Export all managed accounts" from panel. I get internal server error. iRedAdmin-Pro/mlmmjadmin restarted without luck, I get error in logs:

Traceback (most recent call last):#012  File "/usr/lib/python2.6/site-packages/web/application.py", line 239, in process#012    return self.handle()#012  File "/usr/lib/python2.6/site-packages/web/application.py", line 230, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.6/site-packages/web/application.py", line 420, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.6/site-packages/web/application.py", line 396, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-Pro-LDAP-4.0/controllers/decorators.py", line 44, in proxyfunc#012    return func(self, *args, **kw)#012  File "/var/www/iRedAdmin-Pro-LDAP-4.0/controllers/ldap/export.py", line 70, in GET#012    with zipfile.ZipFile(f, mode='w', compression=zipfile.ZIP_DEFLATED) as zf:#012AttributeError: ZipFile instance has no attribute '__exit__'

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Cannot use Export all managed accounts from panel v 4.0

Sorry about this trouble. I will try to reproduce this issue and come back with a fix soon. Stay tuned.

3

Re: Cannot use Export all managed accounts from panel v 4.0

Dear @kamil.szymkowiak,

I just realized you're running Python-2.6 on CentOS 6. I can not reproduce this issue on CentOS 7 with Python-2.7.

- CentOS 6 will be EOL (end of life) on Nov 30th, 2020 (https://wiki.centos.org/About/Product).
- Python-2 will be sunset on Jan 1th, 2020.

So, any plan to upgrade CentOS to 7 and get Python-2.7 and Python-3.x?

4 (edited by kamil.szymkowiak 2019-09-19 15:30:30)

Re: Cannot use Export all managed accounts from panel v 4.0

I'm afraid we won't be upgrading soon. Is there any workaround?

5

Re: Cannot use Export all managed accounts from panel v 4.0

I see we can install python27 from epel repo. Can we force only this script to use python27 instead 2.6?

6 (edited by kamil.szymkowiak 2019-09-19 18:51:15)

Re: Cannot use Export all managed accounts from panel v 4.0

Ok, we have found a solution:
Open iRedAdmin-Pro-LDAP-4.0/controllers/ldap/export.py

++ import contextlib

-- with zipfile.ZipFile(f, mode='w', compression=zipfile.ZIP_DEFLATED) as zf:
++ with contextlib.closing(zipfile.ZipFile(f, mode='w', compression=zipfile.ZIP_DEFLATED)) as zf:

You can close this thread, thanks smile

7

Re: Cannot use Export all managed accounts from panel v 4.0

Upgrading to Python 2.7 should fix the issue too.