Re: [exim] Misunderstanding match_domain and sqlite ...

Top Page
Delete this message
Reply to this message
Author: Lena
Date:  
To: exim-users
Subject: Re: [exim] Misunderstanding match_domain and sqlite ...
> From: Jim Cheetham

> > $ sqlite3 /etc/exim4/mta.db 'select name from domains where status="active"'
> > local.dom
> > good.dom
> > ok.dom
>
> Running this through exim -be shows the problem ... only 'ok.dom' should pass, 'bad.dom' should fail.
> > $ exim -be '${if match_domain{ok.dom}{sqlite; /etc/exim4/mta.db select name from domains where status="active";}{yes}{no}}'
> > yes
> > $ exim -be '${if match_domain{bad.dom}{sqlite; /etc/exim4/mta.db select name from domains where status="active";}{yes}{no}}'
> > yes


Try:
${lookup sqlite{/etc/exim4/mta.db select name from domains where status='active' and name='${quote_sqlite:${lc:bad.com}}'}{yes}{no}}

Possibly quote_sqlite and lc are redunant in this case, but they don't hurt.

All this purely theoretically from documentation, I never used sql.