1

Topic: Forwarding Preference

======== Required information ====
- iRedMail version: 0.9.1
- iRedAdmin version: iRedAdmin-Pro-SQL 2.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Ubuntu 12.04.5 LTS
- Related log if you're reporting an issue: from Apache error log

[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239] Traceback (most recent call last):
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/lib/pymodules/python2.7/web/application.py", line 242, in process
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     return self.handle()
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/lib/pymodules/python2.7/web/application.py", line 233, in handle
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     return self._delegate(fn, self.fvars, args)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/lib/pymodules/python2.7/web/application.py", line 415, in _delegate
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     return handle_class(cls)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/lib/pymodules/python2.7/web/application.py", line 390, in handle_class
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     return tocall(*args)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/share/apache2/iredadmin/controllers/decorators.py", line 61, in decorated
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     return f(*args, **kw)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/share/apache2/iredadmin/controllers/decorators.py", line 49, in proxyfunc
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     return func(self, *args, **kw)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/share/apache2/iredadmin/controllers/sql/user.py", line 586, in POST
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     profile_type=profile_type)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]   File "/usr/share/apache2/iredadmin/libs/sqllib/user.py", line 1243, in update_preferences
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]     qr = _update_user_forwarding_from_form(mail, form)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239] TypeError: _update_user_forwarding_from_form() takes exactly 3 arguments (2 given)
[Sat May 30 22:15:04 2015] [error] [client 67.241.1.239]
====

When adding a forwarding email as a basic user using the self-service, I get an Internal Server Error, with the resulting errors in the Apache error log.

When logged in as a Global Admin adding a forwarding email to my own account, and any other account, does work fine.

I did just perform upgrades to latest versions of iRedmail and iRedAdmin.

Thank you for any help.

----

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

2

Re: Forwarding Preference

Looks like bug in iRedAdmin-Pro, I will try to reproduce it and come back to you later. Thanks very much for the feedback.

3

Re: Forwarding Preference

Confirmed, it's a bug in iRedAdmin-Pro-SQL-2.0, and here's patch to fix it. Sorry about this trouble.

diff -r 3f128b6f6ca8 libs/sqllib/user.py
--- a/libs/sqllib/user.py    Sat May 30 22:34:47 2015 +0800
+++ b/libs/sqllib/user.py    Sun May 31 21:40:42 2015 +0800
@@ -1242,7 +1242,7 @@
                 session['timezone'] = TIMEZONES[tz_name]
 
     elif profile_type == 'forwarding':
-        qr = _update_user_forwarding_from_form(mail, form)
+        qr = _update_user_forwarding_from_form(conn=conn, mail=mail, form=form)
         return qr
 
     elif profile_type == 'password':

4

Re: Forwarding Preference

Yep this worked perfectly.  Thank you!