[Exim] Result of one query in another query *PLEASE HELP*

Top Page
Delete this message
Reply to this message
Author: abaddon
Date:  
To: exim-users
Subject: [Exim] Result of one query in another query *PLEASE HELP*
Hello...

MYSQL_DOMAIN_PSA = select MYSQL_DOMAIN_ID from MYSQL_DOMAIN_TABLE \
where MYSQL_DOMAIN_NAME='${quote_mysql:$domain}'


MYSQL_USER = SELECT DISTINCT MYSQL_DOMAIN_ID FROM MYSQL_AUTHTABLE \
WHERE MYSQL_DOMAIN_ID LIKE '$MYSQL_DOMAIN_PSA ?????@#$@#$' AND \
MYSQL_USERNAMEFIELD LIKE '${quote_mysql:$local_part}'


# Check if user is a real user in mysql database
virtual_local_user:
domains = ${lookup mysql {MYSQL_USER}{$value}}
driver = smartuser
transport = virtual_delivery


How can i parse MYSQL_DOMAIN_PSA result to the MYSQL_USER query ?

Should work something like this:

selecet dom_id from domains where mysql_domain_name='${quote_mysql:
$domain}'

Result: dom_id=52

and than:

MYSQL_USER = SELECT DISTINCT MYSQL_DOMAIN_ID FROM MYSQL_AUTHTABLE \
WHERE MYSQL_DOMAIN_ID LIKE '52' AND \
MYSQL_USERNAMEFIELD LIKE '${quote_mysql:$local_part}'


2 - Second

What option to set to refuse "rcpt to" if user dosent exist ?

Thanks

Abaddon



===================================================================
EASY and FREE access to your email anywhere: http://kralweb.com/mail
===================================================================