1

Topic: [SOLVED] Empty domain list

Hi!

I have setup an email server with iRedMail around one month ago,
everything was working fine.

After 2 weeks, I logged in now, and the domain list in iRedAdmin is empty.

Mail server is still working without problems though, and the database is fine too.

The last thing I did was adding a sub.domain.com and forward alias (manually in Mysql DB)

iRedMail 0.7.2
iRedAdmin v0.1.5 (MySQL)
Ubuntu 10.04.2 LTS

Anyone got any idea?

----

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

2

Re: [SOLVED] Empty domain list

No idea about why it happened. Sorry.

Is it possible to show us the MySQL commands you used to add 'sub.domain.com' and forward alias?
Also, you can try to debug it this way:

- Add 'log = /tmp/mysql.log' in MySQL configure file 'my.cnf', under section '[mysqld]'. After restarting MySQL service, it will log all MySQL commands in /tmp/mysql.log.
- Monitor /tmp/mysql.log, then access iRedAdmin, check which commands it performs when list all mail domains.
- Copy commands in MySQL command line, check its query result.

3 (edited by ted 2011-07-29 21:42:20)

Re: [SOLVED] Empty domain list

Thanks for your help Zhang.

Here we go:

SELECT COUNT( domain.domain ) AS total
FROM domain, domain_admins
WHERE domain.domain = domain_admins.domain
AND domain_admins.username =  '<admin-email-address-here>'

=> RESULT: 0

SELECT
                domain.domain, domain.description, domain.aliases,
                domain.mailboxes, domain.maxquota, domain.quota, 
                domain.transport, domain.backupmx, domain.created,
                domain.active,
                SUM(DISTINCT mailbox.bytes) AS stored_quota,
                SUM(DISTINCT mailbox.quota) AS quota_count,
                COUNT(DISTINCT mailbox.username) AS mailbox_count,
                COUNT(DISTINCT alias.address) AS alias_count
            FROM domain
            LEFT JOIN domain_admins ON (domain.domain = domain_admins.domain)
            LEFT JOIN mailbox ON (domain.domain = mailbox.domain)
            LEFT JOIN alias ON (domain.domain = alias.domain AND alias.address <> alias.goto)
             WHERE domain_admins.username = '<admin-email-address-here>'
            GROUP BY
                domain.domain, domain.description, domain.aliases,
                domain.mailboxes, domain.maxquota, domain.quota, 
                domain.transport, domain.backupmx, domain.created,
                domain.active
            ORDER BY domain.domain
            LIMIT 50
            OFFSET 0

=> RESULT: 0

Table domain_admins is empty, is that normal?

4

Re: [SOLVED] Empty domain list

That means you didn't assign mail domains to he admin account you currently logged in.
To fix it, you can:

- login as GLOBAL admin first, then assign mail domains to this admin account.
- Re-login as that admin account, domain list should be not empty anymore.

5

Re: [SOLVED] Empty domain list

Sorry for mixing up admin accounts.

Theres is and always was only one account (the one from setup), I assume it's the global admin account.

6

Re: [SOLVED] Empty domain list

Table domain_admins is empty, is that normal?

It is wrong. There must be at least one record.

iRedMail will create a global admin account during installation, you can find SQL commands in iRedMail-x.y.z/conf/mysql_init.sql.

7

Re: [SOLVED] Empty domain list

Ok, that was the problem, it's fixed now.

Added one entry in domain_admins manually.

Thank you Zhang!