[exim] mysql_servers misadventure

トップ ページ
このメッセージを削除
このメッセージに返信
著者: John W. Baxter
日付:  
To: Exim Mailing List
題目: [exim] mysql_servers misadventure
CentOS 4.4; locally-built Exim 4.60.

I introduced (in our off-line testing machine) a new ACL with a MySQL
lookup. As often happens when I try to write those, I botched it (even
though I started from a working lookup, reducing the complexity of the WHERE
part).

And the result was a claim (in an initial test using exim -bh blah) that the
MySQL server was unknown. This was the third and last server listed in the
mysql_servers setting.

This was extra confusing as I found that the same server, fed to the command
line
mysql -f server ...
command worked fine.

The wonderful Exim debugging facilities soon put me on the right track:
exim -d -bv blah revealed that the first two servers were complaining of the
syntax error, and the third was unknown.

The reason for the unknown server was that, in the dim past, I had set the
mysql_servers list up with localhost as the first server (OK), a
fully-qualified name for the second (OK), but a bare host name for the
third. It turns out that a fully-qualified name is needed here. We had
just never gotten to the need to try the third server. (Our resolver does
qualify the host properly and return the correct IP, if called asking for
that service.)

I would not object to a "fix" in the code (at which I haven't looked).
However, it should be sufficient to make a slight adjustment in the text
near the start of section 9.21 of the spec:

***
If any MySQL, PostgreSQL, Oracle, or InterBase lookups are used, the
mysql_servers, pgsql_servers, oracle_servers, or ibase_servers option (as
appropriate) must be set to a colon-separated list of server information.
Each item in the list is a slash-separated list of four items: host name,
database name, user name, and password.
***

The revision would call for a fully qualified name.

(Note: I haven't tried this with Exim 4.64; but I don't see anything in the
ChangeLog which would change the results, and the text above comes from the
4.64 spec.txt file.)

--John (who will put something into Bugzilla once there seems to be a
consensus as to whether to fix the code or the spec--and he learns how to
drive Bugzilla)