[Exim] Exim and mysql, reading local_domains and domains rou…

Pàgina inicial
Delete this message
Reply to this message
Autor: Kieran Simkin
Data:  
A: exim-users
Assumpte: [Exim] Exim and mysql, reading local_domains and domains router field from a mysql table.
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Hi, I was wondering if anyone could help me. I'm trying to get exim to read
a list of domains from a table in mysql. The table; called "domains" is a
list of domain names, one per row in the field "domainname". The mysql query
"SELECT domainname FROM domains" works and pulls out the expected list of
domains. However, using the following config line for exim:
local_domains = "leaf:mysql;SELECT domainname FROM domains"
Every domain name seems to be matched (ie domains not on the list).

Here's an extract from a log produced with `exim -bd -q30m -d10`:
----------------------------------------
SMTP<< EHLO mmmmail.com
search_open: mysql "NULL"
search_find: file="NULL"
key="SELECT domainname FROM domains" partial=-1
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT domainname FROM domains"
database lookup required for SELECT domainname FROM domains
MYSQL query: SELECT domainname FROM domains
MYSQL new connection: host=localhost port=0 database=digitalcrocus
user=digitalcrocus password=*******
lookup yielded: clan-ov.co.uk
bob-land.com
drugie.net
high-traffic.net
lewq.net
nixshells.com

..

techno-culture.com
thegeneralist.net
ph
**** debug string overflowed buffer ****
mmmmail.com in local_domains? yes (matched mysql;SELECT domainname FROM
domains)
looking up host name for 66.28.60.245

--------------------------------

I assume that "debug string overflowed buffer" simply means the list is too
long to fit in the string buffer that the debugging output portion of exim's
code is using. The list is not nearly long enough to have problems fitting
in any reasonable sized buffer (no more than 100 domains). mmmmail.com is
not in the table (yes, I have checked).. so what could be the problem?

I have got mysql working for smtp authentication (for relaying) using the
following confuration:

plaintext_login:
        driver = plaintext
        public_name = LOGIN
        server_prompts = "Username:: : Password::"
        server_condition="${if eq {$2} {${lookup mysql{SELECT password FROM
users WHERE username='$1'}}} {1}{0} }"
        server_set_id = $1


and this works fine. I don't really understand the difference between using
"mysql;query" or "${lookup mysql{query}}", neither seems to work for
local_domains.
I'm using exim version 3.36 on freebsd with mysql version 3.23.52.

Any help greatly appreciated, this is driving me nuts.


~Kieran Simkin
Digital Crocus
Hosting and Web Design
http://digital-crocus.com/


--