Hello,
I want to create a listener for configuring Postsrsd. The idea is to query the database for all available domains/subdomain/aliases with
- SELECT CONCAT(subdomain.subdomain_name, '.', domain.`domain_name`) AS name
- FROM subdomain LEFT JOIN domain ON (subdomain.domain_id = domain.domain_id)
- UNION
- SELECT domain.domain_name AS name
- FROM domain
- UNION
- SELECT domain_aliasses.alias_name AS name
- FROM domain_aliasses
- UNION
- SELECT CONCAT(subdomain_alias.subdomain_alias_name, '.', domain_aliasses.alias_name) AS name
- FROM subdomain_alias LEFT JOIN domain_aliasses ON (subdomain_alias.alias_id = domain_aliasses.alias_id)
- ORDER BY name
and to concat this to a string as parameter of postsrsd config.
Generally this is no problem but I am wondering which trigger might be the best for starting the query as this would afterwards also trigger the reload as postsrsd. I was thinking about using afterNamedReload but that would trigger the listener every time a zone gets changed. Normally I just need the trigger when a new domain/subdomain/alias is added or deleted in order to reduce the reload commands towards postsrsd. If there is no special trigger which would fit this need, is it possible to register a listener to more than one trigger at the same time?
Thanks in advance for your feedback.
Regards Jörg