In MYSQL - try:-

SELECT GROUP_CONCAT(domain SEPARATOR ':') AS domain FROM mail_domains

On 2025/04/06 21:43, Ray O'Donnell via Exim-users wrote:
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.

--

Mark James ELKINS  -  Posix Systems - (South) Africa
m...@posix.co.za Tel: +27.826010496 <tel:+27826010496>
For fast, reliable, low cost Internet in ZA: https://ftth.posix.co.za <https://ftth.posix.co.za>



--
## 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