1

Topic: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

==== Required information ====
- iRedMail version: 1.9.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 14.04
- Related log if you're reporting an issue:
====

Hi,

I am unable to delete Alias in the new version in IredAdmin-Pro. It says that it deletes but the alias is still there. I had to remove alias via phpMyAdmin.

----

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

2

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Sorry about this trouble. This should be fixed in iRedAdmin-Pro-MySQL-1.9.2 as mentioned in release notes, not sure why it doesn't work on your server.
http://www.iredmail.org/forum/topic8636 … eased.html

How about i send you a latest version and you upgrade current running version to this one?

3

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

We can do that.

4

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

I sent you an email with download link, please let me know whether or not it fixes your issue.

5

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Still no luck with the version that was sent via e-mail...

6

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

My fault. It's a bug in iRedAdmin-Pro-MySQL-1.9.2. Here's patch to fix it. Please restart Apache or uwsgi service (if you're running Nginx) after applied this patch.

diff -r 1b7bdaf10804 controllers/mysql/alias.py
--- a/controllers/mysql/alias.py    Sat Feb 14 22:58:26 2015 +0800
+++ b/controllers/mysql/alias.py    Fri Feb 20 13:11:53 2015 +0800
@@ -45,7 +45,7 @@
         i = web.input(_unicode=False, mail=[])
         self.domain = web.safestr(domain)
 
-        mails = i.get('mail', [])
+        mails = i.get('username', [])
         action = i.get('action', None)
         msg = i.get('msg', None)

7 (edited by swaclawski 2015-02-21 21:16:47)

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Still no luck.
My code for

 /usr/share/apache2/iredadmin/controllers/mysql/alias.py 

right now:

    def POST(self, domain):
        i = web.input(_unicode=False, mail=[])
        self.domain = web.safestr(domain)

# edit for remove-of-sql-alias-bug by SW 21-02-2015
        mails = i.get('username', [])
        action = i.get('action', None)
        msg = i.get('msg', None)

        aliasLib = aliaslib.Alias()

        if action == 'delete':
            result = aliasLib.delete(domain=self.domain, mails=mails)
            msg = 'DELETED'
        elif action == 'disable':
            result = aliasLib.enable_disable_account(domain=self.domain, accounts=mails, active=False)
            msg = 'DISABLED'
        elif action == 'enable':
            result = aliasLib.enable_disable_account(domain=self.domain, accounts=mails, active=True)
            msg = 'ENABLED'

I get ' Error: INVALID_MAIL '
for Delete
and
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1")
for disable

8

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Could you please show me output of below command:

# grep 'checkbox' templates/default/mysql/alias/list.html

9

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Result:

root@mail1:/usr/share/apache2/iredadmin# grep 'checkbox' templates/default/mysql/alias/list.html
            <th class="checkbox"><input type="checkbox" class="checkbox select-all" /></th>
                <td class="checkbox"><input type="checkbox" name="username" value="{{ address }}" /></td>
            <td class="checkbox"></td>
root@mail1:/usr/share/apache2/iredadmin#

10 (edited by InformaticaTTU 2015-03-09 20:48:24)

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Same here.

Exactly the same error and same outputs. And after applying the patch I get the same "Error: INVALID_MAIL" error.

Is there any fix?

Thanks!!

11

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Dear @swaclawski, @InformaticaTTU,

I sent download link of patched version of iRedAdmin-Pro to both of you moment ago, you can upgrade it by following our tutorial here:
http://www.iredmail.org/docs/migrate.or … admin.html

Please let me know whether or not it works for you.

12

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Thanks!!! now is working fine wink

Greetings!!

13

Re: Unable to delete alias in iRedAdmin-Pro-MySQL 1.9.2

Works for me too. Thanks.