[GH-ISSUE #466] Catchall does not work for domain-alias #450

Closed
opened 2026-02-27 11:11:50 +03:00 by kerem · 3 comments
Owner

Originally created by @tonioo on GitHub (Dec 4, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/466

Originally assigned to: @tonioo on GitHub.

Originally created by C B on 2013-10-10T10:29:19Z

In my postfix-dovecot setup with modoboa 1.0.1 is a domain example.com with an alias of example.alias configurated. The postfix accepts mail for the configured alias username@example.{com,alias} -> external@domain.tld, and the catchall configured for example.com does work as expected. Contrary to the expectation the catchall does not work for the domain-alias example.alias.
A catchall for the domain-alias example.alias cannot be configured in the webinterface, as the domain is unknown.

Originally created by @tonioo on GitHub (Dec 4, 2013). Original GitHub issue: https://github.com/modoboa/modoboa/issues/466 Originally assigned to: @tonioo on GitHub. **Originally created by C B on 2013-10-10T10:29:19Z** In my postfix-dovecot setup with modoboa 1.0.1 is a domain example.com with an alias of example.alias configurated. The postfix accepts mail for the configured alias username@example.{com,alias} -> external@domain.tld, and the catchall configured for example.com does work as expected. Contrary to the expectation the catchall does not work for the domain-alias example.alias. A catchall for the domain-alias example.alias cannot be configured in the webinterface, as the domain is unknown.
kerem closed this issue 2026-02-27 11:11:50 +03:00
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Antoine Nguyen on 2013-10-10T19:51:54Z

Indeed, it is not currently possible to define a catchall for a domain alias. The problem comes from the SQL query used into sql-catchall-aliases.cf.

I'll try to find one that allows this use case. If you really need such catchall, I suggest you create a domain that corresponds to you domain alias and then create a catchall for this domain.

<!-- gh-comment-id:29816771 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Antoine Nguyen on 2013-10-10T19:51:54Z** Indeed, it is not currently possible to define a catchall for a domain alias. The problem comes from the SQL query used into sql-catchall-aliases.cf. I'll try to find one that allows this use case. If you really need such catchall, I suggest you create a domain that corresponds to you domain alias and then create a catchall for this domain.
Author
Owner

@fompi commented on GitHub (Feb 16, 2015):

A workaround is not a solution. In the meantime, I've used this query to solve this problem:

(SELECT mb.address || '@' || dom.name FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id WHERE mb.id IN (SELECT al_mb.mailbox_id FROM admin_alias al INNER JOIN admin_domain dom ON al.domain_id=dom.id INNER JOIN admin_alias_mboxes al_mb ON al.id=al_mb.alias_id WHERE al.enabled AND al.address='*' AND (dom.name='%d' OR dom.name=(SELECT dom.name FROM admin_domain dom INNER JOIN admin_domainalias domal ON dom.id=domal.target_id WHERE domal.name='%d' AND domal.enabled AND dom.enabled)) AND dom.enabled)) UNION (SELECT al.extmboxes FROM admin_alias al INNER JOIN admin_domain dom ON al.domain_id=dom.id WHERE al.enabled AND al.extmboxes<>'' AND al.address='*' AND (dom.name='%d' OR dom.name=(SELECT dom.name FROM admin_domain dom INNER JOIN admin_domainalias domal ON dom.id=domal.target_id WHERE domal.name='%d' AND domal.enabled AND dom.enabled)) AND dom.enabled)

But I assume it should be worked on. Why won't create views to clarify the map files?

<!-- gh-comment-id:74561394 --> @fompi commented on GitHub (Feb 16, 2015): A workaround is not a solution. In the meantime, I've used this query to solve this problem: ``` (SELECT mb.address || '@' || dom.name FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id WHERE mb.id IN (SELECT al_mb.mailbox_id FROM admin_alias al INNER JOIN admin_domain dom ON al.domain_id=dom.id INNER JOIN admin_alias_mboxes al_mb ON al.id=al_mb.alias_id WHERE al.enabled AND al.address='*' AND (dom.name='%d' OR dom.name=(SELECT dom.name FROM admin_domain dom INNER JOIN admin_domainalias domal ON dom.id=domal.target_id WHERE domal.name='%d' AND domal.enabled AND dom.enabled)) AND dom.enabled)) UNION (SELECT al.extmboxes FROM admin_alias al INNER JOIN admin_domain dom ON al.domain_id=dom.id WHERE al.enabled AND al.extmboxes<>'' AND al.address='*' AND (dom.name='%d' OR dom.name=(SELECT dom.name FROM admin_domain dom INNER JOIN admin_domainalias domal ON dom.id=domal.target_id WHERE domal.name='%d' AND domal.enabled AND dom.enabled)) AND dom.enabled) ``` But I assume it should be worked on. Why won't create views to clarify the map files?
Author
Owner

@tonioo commented on GitHub (Feb 17, 2015):

Yes, it could be useful. But I must admit my knowledge about views is pretty limited. Do you have any example ?

<!-- gh-comment-id:74632591 --> @tonioo commented on GitHub (Feb 17, 2015): Yes, it could be useful. But I must admit my knowledge about views is pretty limited. Do you have any example ?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#450
No description provided.