On 06/04/2025 13:19, Joan Moreau via Exim-users wrote:
Hi

I am trying to make my list of local domains from mysql

domainlist mylist = ${lookup mysql{SELECT domain FROM mail_domains}}

However, if the table containts several domains (indeed..), the mylist is not an array of domains and local mails are not recognised

I do the same thing using PostgreSQL - my lookup looks like this (built with help from this list):

    MAIN_LOCAL_DOMAINS = @ : ${lookup pgsql{select string_agg(domain_name, ':') from domains where is_enabled = true}}

This is on Debian, so MAIN_LOCAL_DOMAINS is a macro which is incorporated into the main configuration file by the config-building mechanism. The string_agg() function is an aggregate function which concatenates the results into a string with elements separated by the specified delimiter - in this case a colon, since (as I understand it) Exim expects a colon-delimited string of domains in a domainlist.

HTH,

Ray.

--
Raymond O'Donnell // Galway // Ireland
r...@rodonnell.ie


--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to