Wrong mysql syntax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrong mysql syntax

Mathieu R.
I try to setup a debian/Mysql/Postfix/dovecot server
Here is the error i got in mail.log. I checked my mysql_relay_domains twice, but i can't find my mistake


Nov 7 22:05:10 vps81550 postfix/postscreen[23904]: CONNECT from [209.85.215.51]:52679 to [149.56.x.x]:x
Nov 7 22:05:10 vps81550 postfix/postscreen[23904]: cache btree:/var/lib/postfix/postscreen_cache full cleanup: retained=35 dropped=0 entries
Nov 7 22:05:10 vps81550 postfix/dnsblog[23909]: addr 209.85.215.51 listed by domain dnsbl.sorbs.net as 127.0.0.6
Nov 7 22:05:10 vps81550 postfix/postscreen[23904]: PASS OLD [209.85.215.51]:52679
Nov 7 22:05:10 vps81550 postfix/smtpd[23911]: connect from mail-lf0-f51.google.com[209.85.215.51]
Nov 7 22:05:11 vps81550 postfix/smtpd[23911]: Untrusted TLS connection established from mail-lf0-f51.google.com[209.85.215.51] TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: mysql query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: relay_domains: mysql:/etc/postfix/mysql_relay_domains.cf: table lookup problem
Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: relay_domains lookup failure
Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: relay_domains: mysql:/etc/postfix/mysql_relay_domains.cf: table lookup problem
Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: relay_domains: mysql:/etc/postfix/mysql_relay_domains.cf: table lookup problem
Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: relay_domains lookup failure
Nov 7 22:05:11 vps81550 postfix/smtpd[23911]: NOQUEUE: reject: RCPT from mail-lf0-f51.google.com[209.85.215.51] 451 4.3.0 <[hidden email]>: Temporary lookup failure; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<mail-lf0-f51.google.com>

Here is the content of my mysql_relay_domains :

hosts = 127.0.0.1
user = user
password = password
dbname = dbname
query = SELECT domain FROM domain WHERE domain='%s' and backupmx =


•••

--

Mathieu R.

Reply | Threaded
Open this post in threaded view
|

Re: Wrong mysql syntax

Wietse Venema
Mathieu R.:
> Here is the content of my mysql_relay_domains :
>
> hosts = 127.0.0.1
> user = user
> password = password
> dbname = dbname
> query = SELECT domain FROM domain WHERE domain='%s' and backupmx =
> ???

Your file contains non-ASCII characters. Use "od -cb" to
expose them.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Wrong mysql syntax

Mathieu R.


Le jeu. 9 nov. 2017 à 07:16, Wietse Venema <[hidden email]> a écrit :
Mathieu R.:
> Here is the content of my mysql_relay_domains :
>
> hosts = 127.0.0.1
> user = user
> password = password
> dbname = dbname
> query = SELECT domain FROM domain WHERE domain='%s' and backupmx =
> ???

Your file contains non-ASCII characters. Use "od -cb" to
expose them.

        Wietse

This what i get, but i actually don't know how to read this, and what to do next:

15:55 root@vps81550 /etc/postfix # od -cb mysql_relay_domains.cf
0000000   h   o   s   t   s       =       1   2   7   .   0   .   0   .
        150 157 163 164 163 040 075 040 061 062 067 056 060 056 060 056
0000020   1  \n   u   s   e   r       =       p   o   s   t   f   i   x
        061 012 165 163 145 162 040 075 040 160 157 163 164 146 151 170
0000040  \n   p   a   s   s   w   o   r   d       =       k   a   n   t
        012 160 141 163 163 167 157 162 144 040 075 040 153 141 156 164
0000060   3   r   b   r   a   u  \n   d   b   n   a   m   e       =
        063 162 142 162 141 165 012 144 142 156 141 155 145 040 075 040
0000100   p   o   s   t   f   i   x  \n   q   u   e   r   y       =
        160 157 163 164 146 151 170 012 161 165 145 162 171 040 075 040
0000120   S   E   L   E   C   T       d   o   m   a   i   n       F   R
        123 105 114 105 103 124 040 144 157 155 141 151 156 040 106 122
0000140   O   M       d   o   m   a   i   n       W   H   E   R   E
        117 115 040 144 157 155 141 151 156 040 127 110 105 122 105 040
0000160   d   o   m   a   i   n   =   '   %   s   '       a   n   d
        144 157 155 141 151 156 075 047 045 163 047 040 141 156 144 040
0000200   b   a   c   k   u   p   m   x       =  \n
        142 141 143 153 165 160 155 170 040 075 012
0000213
 
--

Mathieu R.

Reply | Threaded
Open this post in threaded view
|

Re: Wrong mysql syntax

Pau Amma
In reply to this post by Mathieu R.
On Thu, November 9, 2017 12:03 pm, Mathieu R. wrote:
> I try to setup a debian/Mysql/Postfix/dovecot server
> Here is the error i got in mail.log. I checked my mysql_relay_domains
> twice, but i can't find my mistake

...

> Nov 7 22:05:11 vps81550 postfix/trivial-rewrite[23471]: warning: mysql
> query failed: You have an error in your SQL syntax; check the manual that
> corresponds to your MariaDB server version for the right syntax to use
> near
> '' at line 1

...

> Here is the content of my mysql_relay_domains :
>
> hosts = 127.0.0.1
> user = user
> password = password
> dbname = dbname
> query = SELECT domain FROM domain WHERE domain='%s' and backupmx =

And indeed, your SQL query looks truncated to me. What should backupmx be
compared to?

Reply | Threaded
Open this post in threaded view
|

Re: Wrong mysql syntax

Benny Pedersen-2
In reply to this post by Mathieu R.

thanks for exposse mysql passwords, you now have to select a new diffrent one, never post passwords