---------------------------- Original Message ----------------------------
Subject: Re: [exim] Unrouteable address ERROR]
From: "Magnus Holmgren" <holmgren@???>
Date: Thu, May 4, 2006 5:59 pm
To: exim-users@???
--------------------------------------------------------------------------
Thursday 04 May 2006 16:29 skrev oleg@???:
> Well Magnus, i wish i can test all by myself, but it is a working
server, and my users will kill me, if i startt testing. I just tried to
make union queries in mysql and it didnt work, i guess some syntax
errors ..How do a join 2 lookups with exim not with mysql, i tried as
from an example, joining by "/"
>
> data = ${lookup mysql{SELECT sendto FROM aliases \
> WHERE (username='$local_part' AND domainname='$domain') \ OR
(username='*' AND domainname='$domain')}}/
> ${lookup mysql{ SELECT id FROM users \
> WHERE id='${quote_mysql:${local_part}@${domain}}' }}
>
> but it gives an error( option setting expected). Searched in exim manual
dindn't find a single hint.
If that's copied exactly from your configuration, then the error message
is due to the fact that you didn't end the third line with "\".
However, items in the redirection data must be separated by commas or
newlines, as stated in section 22.4 of the spec.
I was thinking more along the lines of
virtual_user_or_alias:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{ SELECT maildir FROM users \
WHERE id='${quote_mysql:${local_part}@${domain}}' }} \n\
${lookup mysql{SELECT sendto FROM aliases \
WHERE (username='$local_part' AND domainname='$domain') \ OR
(username='*' AND domainname='$domain')}}
file_transport = address_file
pipe_transport = address_pipe
directory_transport = address_directory
but I don't know what Exim would say about empty lines. This data setting
could also work (assuming MySQL 4.0 or later):
data = ${lookup mysql{ SELECT maildir FROM users \
WHERE id='${quote_mysql:$local_part@$domain}' \
UNION SELECT sendto FROM aliases \
WHERE (username='${quote_mysql:$local_part}' AND \
domainname='${quote_mysql:$domain}') \
OR (username='*' AND domainname='${quote_mysql:$domain}')}}
---------------------------------------
Well what can i say, it works!! thanks a lot. I managed the aliases to
generate also the real addresses like in one of the options you said.
Something like that:
mysql_aliases:
driver = redirect
file_transport = address_file
pipe_transport = address_pipe
data = ${lookup mysql{SELECT sendto FROM aliases \
WHERE (username='$local_part' AND domainname='$domain') \
OR (username='*' AND domainname='$domain')}}\n \
${lookup mysql{ SELECT id FROM users \
WHERE id='${quote_mysql:${local_part}@${domain}}' }}
virtual_user:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{ SELECT maildir FROM users \
WHERE id='${quote_mysql:${local_part}@${domain}}' }}
directory_transport = address_directory
Actually i think it doesn't make sens to make the second
search(mysql_aliases) it is obviously the ${local_part}@${domain}} answer.
Maybe i can append it somehow,
data = ${lookup mysql{SELECT sendto FROM aliases \
WHERE (username='$local_part' AND domainname='$domain') \
OR (username='*' AND domainname='$domain')}}\n \
:${local_part}@${domain}}
???
anyway it works..thanks !!
Oleg R.