1

Topic: Error when deleting a user

==== 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 Linux release 7.6.1810 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? 3.1 ()
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After the last update to 0.9.9 ans iRedAdmin 3.1 I get an error when deleting a user. The error message says

Error: UnboundLocalError("local variable '_lists' referenced before assignment",)

Any ideas?  Thanks in advance
Jens

----

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

2

Re: Error when deleting a user

Try this patch:

diff -r 729c0fd85ef6 libs/mlmmj/__init__.py
--- a/libs/mlmmj/__init__.py    Sat Jan 26 16:54:35 2019 +0800
+++ b/libs/mlmmj/__init__.py    Sun Jan 27 23:29:44 2019 +0800
@@ -353,8 +353,10 @@
         return (False, 'INVALID_EMAIL')
 
     qr = get_subscribed_lists(mail=subscriber, email_only=True)
-    if qr[0]:
-        _lists = qr[1]
+    if not qr[0]:
+        return qr
+
+    _lists = qr[1]
 
     _errors = []
     for ml in _lists:

3

Re: Error when deleting a user

What is the path and what is the file name that this patch should be inserted into

Thanks
Keith

4

Re: Error when deleting a user

kdmiller45 wrote:

What is the path and what is the file name that this patch should be inserted into

This patch is for iRedAdmin-Pro-SQL-3.1 and iRedAdmin-Pro-LDAP-3.3.