1

Topic: Forwarding bug?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Ubuntu 16.03.1 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? YES 2.8.0
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
When looking at the list of users it displays "G#" next to the users that are members of an alias with the # being how many aliases. It also displays a "F#" if there is forwarding on the user. One thing I've noticed is that when looking up a user using the search bar at the top. the search results will show all users in the search have a "F1" next to their name, and when you hover the mouse over it is shows it is being forwarded to themselves when there is no forwarding setup for the user. No functionality seems to be affected by this, it is just annoying from an OCD point of view smile

----

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

2

Re: Forwarding bug?

Could you help capture a screenshot to help us understand this issue?

3

Re: Forwarding bug?

Sure......
The first screen shot shows the users when just looking under "users" from the "domain", notice there is no forwarding listed....
The second screen shot is the forwarding section for the user lucas, again no forwarding listed
The third screen shot is from finding lucas via the search function at the top of the iRedAdmin Pro page, now it shows a forwarding active, when you hover the mouse over the forward it displays the users own email address as the forward....

Post's attachments

iredcapture.JPG
iredcapture.JPG 42.6 kb, file has never been downloaded. 

iredcapture2.jpg
iredcapture2.jpg 33.6 kb, file has never been downloaded. 

iredcapture3.jpg
iredcapture3.jpg 30.96 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

4

Re: Forwarding bug?

Confirmed and fixed. Here's patch for iRedAdmin-Pro-SQL-2.8.0 to fix it.
Thank you very much for your feedback. big_smile

diff -r 47ced843e66e templates/default/sql/search.html
--- a/templates/default/sql/search.html    Tue Sep 19 08:42:53 2017 +0800
+++ b/templates/default/sql/search.html    Tue Sep 19 10:14:39 2017 +0800
@@ -258,7 +258,7 @@
                                         {{ set_account_activity_img('sent', 'user', username) }}
                                         {{ set_account_status_img(r.active) }}
                                         {{ set_assigned_groups_img(addresses=user_assigned_groups.get(username, [])) }}
-                                        {{ set_forwarding_address_img(user=mail, addresses=user_forwarding_addresses.get(username, [])) }}
+                                        {{ set_forwarding_address_img(user=username, addresses=user_forwarding_addresses.get(username, [])) }}
                                         {{ set_alias_address_img(addresses=user_alias_addresses.get(username, [])) }}
                                         <a href="{{ctx.homepath}}/profile/user/general/{{username}}" title="{{ _('Edit account profile') }}">{% if r.name %}{{ r.name |cut_string |e }}{% else %}{{ r.username.split('@', 1)[0] }}{% endif %}</a>
                                     </td>

5

Re: Forwarding bug?

You're welcome for the feedback, and thanks for all that you do with iRedMail.
I'm not that great when it comes to MySQL, I can follow directions pretty well, can you tell me exactly what I need to do to patch this?

ZhangHuangbin wrote:

Confirmed and fixed. Here's patch for iRedAdmin-Pro-SQL-2.8.0 to fix it.
Thank you very much for your feedback. big_smile

diff -r 47ced843e66e templates/default/sql/search.html
--- a/templates/default/sql/search.html    Tue Sep 19 08:42:53 2017 +0800
+++ b/templates/default/sql/search.html    Tue Sep 19 10:14:39 2017 +0800
@@ -258,7 +258,7 @@
                                         {{ set_account_activity_img('sent', 'user', username) }}
                                         {{ set_account_status_img(r.active) }}
                                         {{ set_assigned_groups_img(addresses=user_assigned_groups.get(username, [])) }}
-                                        {{ set_forwarding_address_img(user=mail, addresses=user_forwarding_addresses.get(username, [])) }}
+                                        {{ set_forwarding_address_img(user=username, addresses=user_forwarding_addresses.get(username, [])) }}
                                         {{ set_alias_address_img(addresses=user_alias_addresses.get(username, [])) }}
                                         <a href="{{ctx.homepath}}/profile/user/general/{{username}}" title="{{ _('Edit account profile') }}">{% if r.name %}{{ r.name |cut_string |e }}{% else %}{{ r.username.split('@', 1)[0] }}{% endif %}</a>
                                     </td>

6

Re: Forwarding bug?

Since this patch is very simple, you can apply the change manually:

- Open file 'templates/default/sql/search.html', find line below (near line 258):

                                        {{ set_forwarding_address_img(user=mail, addresses=user_forwarding_addresses.get(username, [])) }}

- Replace it by:

                                        {{ set_forwarding_address_img(user=username, addresses=user_forwarding_addresses.get(username, [])) }}

- Save your change. That's it.

Usually restarting Apache or uwsgi (if you're running Nginx) is required if you modify any Python source file (.py), but this is html template, no need to restart services in this case.

7

Re: Forwarding bug?

ZhangHuangbin wrote:

Since this patch is very simple, you can apply the change manually:

- Open file 'templates/default/sql/search.html', find line below (near line 258):

                                        {{ set_forwarding_address_img(user=mail, addresses=user_forwarding_addresses.get(username, [])) }}

- Replace it by:

                                        {{ set_forwarding_address_img(user=username, addresses=user_forwarding_addresses.get(username, [])) }}

- Save your change. That's it.

Usually restarting Apache or uwsgi (if you're running Nginx) is required if you modify any Python source file (.py), but this is html template, no need to restart services in this case.

I tried to edit the file by using     sudo nano /templates/default/sql/search.html    but it says that directory does not exist....

8

Re: Forwarding bug?

i see you're running Ubuntu 16.04, the file should be: /opt/www/iredadmin/templates/default/sql/search.html

9

Re: Forwarding bug?

Perfect, that fixed it. Thank you very much