Am 08.11.2013 16:18, schrieb Viktor Dukhovni:
> On Fri, Nov 08, 2013 at 03:45:03PM +0100, Tobi wrote:
>
>> The error message is 99.999% not from mysql. Because when I remove the
>> backticks around the table name then I get an error from mysql which
>> looks different
> That error is also from MySQL.  Postfix does not parse SQL queries,
> the database client and server code do.
>
>> And as this is a cluster based setup it's (imho) not possible that one
>> client can see the table and another not
> Databases do have access controls.  And differnt ip:port means NAT
> devices and/or load-balancers in the way, which may be consistently
> connecting you to a different server in the cluster.  In any case:
>
> Post the output of: 
>
>     $ cat -etv /path/table.cf
<<
hosts = 192.168.200.113$
port = 3308$
user = postfix$
password = XXXXX$
dbname = postfix$
query = SELECT 'reject' FROM `blacklist-cidr` WHERE inet_aton('%s')
BETWEEN `network` AND `broadcast`$
>>
>
> where "/path/table.cf" is the table config file in question.  Also
> post the output of 
>
>       postmap -v -q 192.0.2.1 mysql:/path/table.cf
<<
postmap -v -q 192.168.2.1 mysql:/etc/postfix/mysql-blacklist.cf
postmap: name_mask: ipv4
postmap: inet_addr_local: configured 5 IPv4 addresses
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: user = postfix
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: password = london21
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: dbname = postfix
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: result_format = %s
postmap: cfg_get_int: /etc/postfix/mysql-blacklist.cf: expansion_limit = 0
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: query = SELECT
'reject' FROM `blacklist-cidr` WHERE inet_aton('%s') BETWEEN `network`
AND `broadcast`
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: domain =
postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: hosts =
192.168.200.113
postmap: dict_open: mysql:/etc/postfix/mysql-blacklist.cf
postmap: dict_mysql_get_active: attempting to connect to host
192.168.200.113
postmap: dict_mysql: successful connection to host 192.168.200.113
postmap: warning: mysql query failed: Table 'postfix.blacklist-cidr'
doesn't exist
postmap: fatal: table mysql:/etc/postfix/mysql-blacklist.cf: query
error: Success
>>
>
> showing the database parameters and query (feel free to hide the
> password value).  Also post the exact same query typed into the
> mysql command-line interpreter.
mysql -upostfix -pXXXXX -h 192.168.200.113 -P 3308
mysql> use postfix
Database changed
mysql> SELECT 'reject' FROM `blacklist-cidr` WHERE
inet_aton('192.168.2.1') BETWEEN `network` AND `broadcast`;
Empty set (0.08 sec)

>
> Do make sure the username and password sent by "postmap" are
> IDENTICAL to the username and password you specify interactively.
> Table access permissions may depend on the user login.
>
> Anyway, this is really not a Postfix issue.  Don't blame the
> messenger, Postfix just prints the errors reported by the MySQL
> library.  You really must treat this as you would any other problem
> with a MySQL application, check the login settings, query settings,
> ...
>
Think I found it :-) I stated port = 3308 which seems wrong. After
stating hosts = 192.168.200.113:3308 it works
Thanks Victor for putting me in the right way. I just found out when
getting the output you requested

So case closed: error reason 30cm in front of the screen
Sorry for blaming postfix :-)

tobi

Reply via email to