---------------------------- Original Message ----------------------------
Subject: Re: [exim] Unrouteable address ERROR]
From:    "Magnus Holmgren" <[EMAIL PROTECTED]>
Date:    Thu, May 4, 2006 5:59 pm
To:      [email protected]
--------------------------------------------------------------------------

Thursday 04 May 2006 16:29 skrev [EMAIL PROTECTED]:
> 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:[EMAIL PROTECTED]' }}
>
> 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:[EMAIL PROTECTED]' }} \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:[EMAIL PROTECTED]'  \
          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:[EMAIL PROTECTED]' }}

virtual_user:
  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup mysql{ SELECT maildir FROM users \
          WHERE id='${quote_mysql:[EMAIL PROTECTED]' }}
  directory_transport = address_directory

Actually i think it doesn't make sens to make the second
search(mysql_aliases) it is obviously the [EMAIL PROTECTED] 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 \
          :[EMAIL PROTECTED]
???
anyway it works..thanks !!

Oleg R.

Attachment: untitled-1.2
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