Re: [Exim] mysql help

Top Page
Delete this message
Reply to this message
Author: Patrick Boutilier
Date:  
To: exim-users
Subject: Re: [Exim] mysql help
Matt,

This might work:


local_user:
driver = accept

condition = ${if eq {}{${lookup mysql {select username from
email_addresses where username='${lc:$local_part}' and
domain='${lc:$domain}'}}}{no}{yes}}

retry_use_local_part
transport = local_delivery


Matt Jones wrote:
> This is a multi-part message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
> ok i have a bit of a problem
>
> im trying to use mysql as a backend for email users, now, this is what i have working.....
>
> local domains are grabbed from mysql.
>
> now what i want is for exim to check the user exists in the db, and not on the system
>
> the database structure:
>
> Table name: email_addresses
> |--- username
> |--- password
> |--- domain
>
> so how would i check the user exists in the db?
>
> currently its checking the server users:
>
> localuser:
> driver = accept
> check_local_user
> transport = local_delivery
> cannot_route_message = Unknown user
>
> im not sure how to do this, its gotta chack the user exists, BUT, also, at the same time, check that the user exists for the domain the the email is being sent to
>
> for example, on the server might be a user: matt
>
> matt may exist for example.com but not for example2.com
>
> so i want mail to matt@??? to be accepted but not to matt@???.
>
> in the email_addresses table the username and the domain are stored for each user so that check is possible but how?
>
> could anyone give me an example?
>
> thanx in advance
>
> Matt.
> --
>
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>