1

Topic: Search not working as expected.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):  1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: Debian 10.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.
====

After upgrade to version 4.6 search field not working as expected. If I search full address email user@domain.com it works but when I try to search sth like "domain" than it is finished by "internal server error"

2

Re: Search not working as expected.

I can reproduce this issue and fixed moment ago.
Here's patch for iRedAdmin-Pro-SQL-4.6. If you're not familiar with patch, please contact us to get a patched version.

diff --git a/templates/default/sql/search.html b/templates/default/sql/search.html
index c1e09358..d67bb0ef 100644
--- a/templates/default/sql/search.html
+++ b/templates/default/sql/search.html
@@ -132,18 +132,18 @@
 
                                         {# Mailboxes #}
                                         <td class="vcenter" data-sort-value="{{ r.mailboxes |e }}">
-                                            {% if r.mailboxes >= 0 %}
+                                            {% if (r.mailboxes |int) >= 0 %}
                                                 <a href="{{ctx.homepath}}/users/{{domain}}" title="{{ _('List all mail users.') }}" style="text-decoration: none;">{{ display_number_of_account_limited(r.mailboxes, hide_unlimited=false, hide_slash=true) }}</a>
-                                            {% elif r.mailboxes == -1 %}
+                                            {% elif (r.mailboxes |int) == -1 %}
                                                 <span class="color-grey"><em>{{ _('DISABLED') }}</em></span>
                                             {% endif %}
                                         </td>
 
                                         {# Aliases #}
                                         <td class="vcenter" data-sort-value="{{ r.aliases |e }}">
-                                            {% if r.aliases >= 0 %}
+                                            {% if (r.aliases |int) >= 0 %}
                                                 <a href="{{ctx.homepath}}/aliases/{{domain}}" title="{{ _('List all mail aliases.') }}" style="text-decoration: none;">{{ display_number_of_account_limited(r.aliases, hide_unlimited=false, hide_slash=true) }}</a>
-                                            {% elif r.aliases == -1 %}
+                                            {% elif (r.aliases |int) == -1 %}
                                                 <span class="color-grey"><em>{{ _('DISABLED') }}</em></span>
                                             {% endif %}
                                         </td>
@@ -279,7 +279,7 @@
                                     </td>
                                     <td class="vcenter">{{ highlight_username_in_mail(mail) }}</td>
                                     <td class="vcenter">{% if r.employeeid %}{{ r.employeeid |e }}{% endif %}</td>
-                                    {% if r.quota == 0 %}
+                                    {% if (r.quota |int) == 0 %}
                                         <td class="vcenter" data-sort-value="0">{{ _('Unlimited') }}</td>
                                     {% else %}
                                         <td class="vcenter" data-sort-value="{{ r.quota |e }}">{{ r.quota | file_size_format(base_mb=True) }}</td>

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

3

Re: Search not working as expected.

Now works perfect ;-) Thanks.