[Exim] Re: No search in domainlist after ::

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Thomas Mueller
Date:  
À: exim-users
Sujet: [Exim] Re: No search in domainlist after ::
On Thu, 22 Apr 2004 09:49:08 +0100 Philip Hazel wrote:

>> domainlist local_domains = @:localhost:${lookup pgsql{SELECT DISTINCT name FROM
>> domains WHERE name='${quote_pgsql:$domain}'}}:${lookup pgsql{SELECT
>> DISTINCT name FROM records WHERE name='${quote_pgsql:$domain}'}}
>>
>> When I send mail to user@??? I get:
>>
>> sub.example.com in "@:localhost::sub.example.com"? no (end of list)
>> sub.example.com in "+local_domains"? no (end of list)
>
> The other poster pointed out that you might want to use the other lookup
> syntax.


I don't understand why. ${lookup returns newline terminated strings. That
would be a problem if I'd use:
... = ${lookup pgsql{SELECT DISTINCT name FROM domains}}
Because I'd get back a list then. In my case I always get back 0 or 1
items but never a list so it shouldn't matter?

> However, looking at what you have... Note that :: in a colon-separated
> list is a way of representing a literal colon. So Exim is trying to
> match either "@" or "localhost:sub.example.com" and of course failing.
>
> You can solve this problem (if this really is the way you want to do
> this - there are cases when it is reasonable) by ensuring there is a
> space between the colons. Thus, your second line should be
>
>  domains WHERE name='${quote_pgsql:$domain}'}} : ${lookup pgsql{SELECT
>                                               ^ ^


Yes that did the trick, thanks for your help!

I don't know if that's the way I want to do it - I simply don't know a
better way :-)


Thomas
--
http://www.tmueller.com for pgp key (95702B3B)