Just got it fixed with help from another iRedAdmin-Pro customer. Here's the patch for iRedAdmin-Pro-SQL-4.5 to fix it.
NOTE: if you're not familiar with patch, please mail us to get a patched version for upgrade (https://docs.iredmail.org/migrate.or.upgrade.iredadmin.html ).
diff --git a/libs/sqllib/user.py b/libs/sqllib/user.py
index 37c4a2e0..e1be2e1c 100644
--- a/libs/sqllib/user.py
+++ b/libs/sqllib/user.py
@@ -1872,6 +1872,7 @@ def get_assigned_aliases(mail, conn=None):
_addr = str(r.address).lower()
_groups.append(_addr)
+ _groups.sort()
return (True, _groups)
except Exception as e:
return (False, repr(e))
diff --git a/libs/sqllib/utils.py b/libs/sqllib/utils.py
index d021a4f8..6f5849ad 100644
--- a/libs/sqllib/utils.py
+++ b/libs/sqllib/utils.py
@@ -267,7 +267,7 @@ def search(search_string,
# Get email addresses of returned user accounts
_user_emails = []
for i in result['user']:
- _user_emails.append(str(i.username).lower())
+ _user_emails.append(str(i['username']).lower())
_user_emails.sort()
# Get per-user alias and mail forwarding addresses
diff --git a/templates/default/sql/user/profile.html b/templates/default/sql/user/profile.html
index 3cc2ec29..88d4605f 100644
--- a/templates/default/sql/user/profile.html
+++ b/templates/default/sql/user/profile.html
@@ -264,7 +264,7 @@
<h4 class="size-250 fl-space">{{ _('Member of Mail Aliases') }}</h4>
<div class="checklist clear">
<fieldset>
- {% for _profile in all_aliases |sort %}
+ {% for _profile in all_aliases %}
{% set _name = _profile.name |e %}
{% set _mail = _profile.address |e %}
@@ -278,7 +278,7 @@
{% endfor %}
{# Display assigned aliases which is not in same domain as current user #}
- {% for _mail in assigned_aliases |sort %}
+ {% for _mail in assigned_aliases %}
{% if not _mail.endswith('@' + cur_domain) %}
<div class="checklist-item">
<span class="fl-space">
@@ -437,7 +437,7 @@
rows="6"
style="width: 50%"
class="textarea"
- >{%- for addr in user_alias_addresses |sort %}{{ addr |e }}
+ >{%- for addr in user_alias_addresses %}{{ addr |e }}
{% endfor -%}
</textarea>
</div>