1

Topic: Catch-all page on iRedAdmin-Pro-MySQL

It seems it does not retrieve the information from the database when you enable a catch all. If you go back there it's empty.
I had a look and changed the following:

on /usr/share/apache2/iRedAdmin-Pro-MySQL-1.0/libs/mysql/domain.py

There is this piece of code:

            qr = self.conn.query(
                '''
                SELECT
                    domain.*,
                    sbcc.bcc_address AS sbcc_addr,
                    sbcc.active AS sbcc_active,
                    rbcc.bcc_address AS rbcc_addr,
                    rbcc.active AS rbcc_active,
                    alias.goto AS catchall,
                    alias.active AS catchall_active,
                    COUNT(DISTINCT mailbox.username) AS mailbox_count,
                    COUNT(DISTINCT alias.address) AS alias_count
                FROM domain
                LEFT JOIN sender_bcc_domain AS sbcc ON (sbcc.domain=domain.domain)
                LEFT JOIN recipient_bcc_domain AS rbcc ON (rbcc.domain=domain.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
                    AND alias.address <> %s
                    )
                WHERE domain.domain=%s
                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 1
                ''' % (web.sqlquote(self.domain),
                       web.sqlquote(self.domain),
                      )

I've commented out the line that says:

AND alias.address <> %s

And now things work. I don't think it will affect anything else.


Cheers,

Christian

2

Re: Catch-all page on iRedAdmin-Pro-MySQL

Thanks very much for your feedback and patch.

New version of iRedAdmin-Pro  will be available on May 01, with this fix.

Thanks again. smile

3

Re: Catch-all page on iRedAdmin-Pro-MySQL

I've also created a workaround to get domain aliases + catchall working. At first if I had the user christian@domain.com and set up an alias, for example: alias.com, messages to christian@alias.com were not working. After investigating for a while I figured out the messages were not being relayed due to not being on the relay list.

I changed the following line on /etc/postfix/mysql/relay_domains.cf:

query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1

I've changed it to:

query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1 union select alias_domain from alias_domain where alias_domain='%s' and active=1

And then it all works. I'm not sure if this is a final fix but I got things going that way. I think more people asked for that already.

Cheers,

Christian

4

Re: Catch-all page on iRedAdmin-Pro-MySQL

atros wrote:

I've changed it to:
query       = SELECT domain FROM domain WHERE domain='%s' AND backupmx=1 AND active=1 union select alias_domain from alias_domain where alias_domain='%s' and active=1

That's cool. Domain alias support in relay domain.

Will commit this fix into iRedMail-0.7.1 later. Thanks very much. smile