1 (edited by marius.timukas 2019-06-11 16:44:05)

Topic: unable to delete mail alias from search page

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes (3.4)
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Unable to delete mail alias from search page. I'm getting internal server errors.

x.x.x.x - - [11/Jun/2019:11:24:07 +0300] "POST /iredadmin/action/alias HTTP/1.1" 500 32 "https://x.x.x.x/iredadmin/search" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"

If I go to "Domains and Accounts", select "Domain" and go to "Aliases", then I can delete mail alias.

2

Re: unable to delete mail alias from search page

marius.timukas wrote:

Unable to delete mail alias from search page. I'm getting internal server errors.

Could you upgrade to iRedAdmin-Pro-SQL-3.5 and try again?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: unable to delete mail alias from search page

ZhangHuangbin wrote:
marius.timukas wrote:

Unable to delete mail alias from search page. I'm getting internal server errors.

Could you upgrade to iRedAdmin-Pro-SQL-3.5 and try again?

    Hello,

The same, unable to delete mail alias from search page. Error message "internal server error".

4

Re: unable to delete mail alias from search page

marius.timukas wrote:

The same, unable to delete mail alias from search page. Error message "internal server error".

Dear Marius,

I can not reproduce this error. Do you have any error in Nginx log file related to this error?
Nginx or uwsgi always log detailed log for "internal server error".

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

5

Re: unable to delete mail alias from search page

ZhangHuangbin wrote:
marius.timukas wrote:

The same, unable to delete mail alias from search page. Error message "internal server error".

Dear Marius,

I can not reproduce this error. Do you have any error in Nginx log file related to this error?
Nginx or uwsgi always log detailed log for "internal server error".


  Hello,

x.x.x.x - - [17/Jun/2019:15:42:02 +0300] "POST /iredadmin/action/alias HTTP/1.1" 500 32 "https://x.x.x.x/iredadmin/search" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"

Jun 17 15:42:02 mail uwsgi: Traceback (most recent call last):#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process#012    return self.handle()#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 230, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 420, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 396, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-Pro-SQL-3.5/controllers/decorators.py", line 120, in decorated#012    return f(*args, **kw)#012  File "/var/www/iRedAdmin-Pro-SQL-3.5/controllers/decorators.py", line 42, in proxyfunc#012    return func(self, *args, **kw)#012  File "/var/www/iRedAdmin-Pro-SQL-3.5/controllers/sql/basic.py", line 414, in POST#012    keep_mailbox_days=keep_mailbox_days,#012UnboundLocalError: local variable 'keep_mailbox_days' referenced before assignment
Jun 17 15:42:02 mail uwsgi: ent
Jun 17 15:42:02 mail uwsgi: x.x.x.x [pid: 30960|app: 1|req: 167/232] x.x.x.x () {58 vars in 1075 bytes} [Mon Jun 17 15:42:02 2019] POST /iredadmin/action/alias => generated 21 bytes in 6 msecs (HTTP/1.1 500) 2 headers in 165 bytes (2 switches on core 0)

6

Re: unable to delete mail alias from search page

Confirmed it's a bug of iRedAdmin-Pro. Patch for iRedAdmin-Pro-SQL-3.5 attached. Thank you very much for the feedback. smile

diff -r be19b1f41a86 controllers/sql/basic.py
--- a/controllers/sql/basic.py  Tue Jun 11 11:12:31 2019 +0800
+++ b/controllers/sql/basic.py  Mon Jun 17 22:03:35 2019 +0800
@@ -393,6 +393,7 @@
                                                   account_type=accountType,
                                                   enable_account=False)
         elif action in ['delete']:
+            keep_mailbox_days = 0  # keep forever
             if accountType in ['user', 'domain']:
                 keep_mailbox_days = form_utils.get_single_value(form=form,
                                                                 input_name='keep_mailbox_days',

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee