Author: Patrick D. Avery Date: To: exim-users Subject: [Exim] MySQL Group expansion trouble
I am running exim 3.36 and I have the following director setup in my
configure file...
mysql_group_aliases:
driver = aliasfile
file_transport = address_file
pipe_transport = address_pipe
search_type = mysql
query = "SELECT username FROM users, divisions WHERE users.division =
divisions.divId AND LCASE(divisions.emailName) = LCASE('$local_part')"
My divisions table simply maps a common email group
name(divisions.emailName) to a division id(divisions.divId). So, my
query checks to see if $local_part matches one of the division common
email group names and if it does attempts to expand a list of users that
have that id in their users.division field.
When I execute this query by hand it produces a proper list of the users
in the particular division. However, when Exim processes the query it
says, "MYSQL: query failed: Unknown column 'divisions.emailName' in
'where clause'".
Here is a snippet of the debug level 10 code I have collected.
---------------------------------------
calling mysql_group_aliases director
df_lookup entered: search type = mysql
mysql_group_aliases director: mysql query=SELECT username FROM users,
divisions WHERE users.division = divisions.divId AND
LCASE(divisions.emailName) = LCASE('corp')
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT username FROM users, divisions WHERE users.division =
divisions.divId AND LCASE(divisions.emailName) = LCASE('corp')"
partial=-1
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT username FROM users, divisions WHERE
users.division = divisions.divId AND LCASE(divisions.emailName) =
LCASE('corp')"
database lookup required for SELECT username FROM users, divisions WHERE
users.division = divisions.divId AND LCASE(divisions.emailName) =
LCASE('corp')
MYSQL query: SELECT username FROM users, divisions WHERE users.division
= divisions.divId AND LCASE(divisions.emailName) = LCASE('corp')
MYSQL using cached connection for
frits.nationalservicesgroup.com/DEVFrits2002/frits/lns8t3
MYSQL: query failed: Unknown column 'divisions.emailName' in 'where
clause'
lookup deferred
mysql_group_aliases director deferred corp
message: search_find deferred: MYSQL: query failed: Unknown column
'divisions.emailName' in 'where clause'
SMTP>> 451 Cannot check <corp@???> at this time - please try later
SMTP<< QUIT