On Monday 15 January 2007 16:14, Adam KOSA wrote:
>   deny hosts          = \N^.*demo1.*$\N
>       log_message     = $sender_host_address is required to use ISP SMTP
>       message         = $sender_host_address rejected: You are required
> \ to use your ISP's SMTP server!
>
> Testing confirmed it's ok.  So i continued to transform the config to this:
>
> hostlist domain_reject = ${lookup mysql {SELECT concat(domain, ' : ')
> from domain_reject order by domain}}
>
> (this was a single line in the config, no linebreaks)
>
> deny hosts          = +domain_reject
>       log_message     = $sender_host_address is required to use ISP SMTP
>       message         = $sender_host_address rejected: You are required
> \ to use your ISP's SMTP server!
>
> And the sql table:
> mysql> select * from domain_reject;
> +------------------------+
> | domain                 |
> +------------------------+
> | \N^.*demo1.*$\N        |
> | \N^.*\.demo2\..*$\N    |
> +------------------------+

By default a query-style ${lookup ...} expansion returns all matching records 
separated by *newlines*, not the colons you need. And since you have to 
extract all records and match against each in turn you could simply put all 
patterns in a text file, one pattern per line, and refer to it by filename, 
like so:

  hostlist domain_reject = /etc/exim/domain_reject

-- 
Magnus Holmgren        [EMAIL PROTECTED]
                       (No Cc of list mail needed, thanks)

Attachment: pgpl8ZeOfVkP8.pgp
Description: PGP signature

-- 
## List details at http://www.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to