Loading ...
Sorry, an error occurred while loading the content.

What is table='t'

Expand Messages
  • Stephen Liu
    Hi folks, I have a /etc/postfix/mysql_*.cf file with following content; user=mail password=mypasswd dbname=maildb table= t select_field=domains
    Message 1 of 8 , Dec 1, 2008
    • 0 Attachment
      Hi folks,


      I have a /etc/postfix/mysql_*.cf file with following content;
      user=mail
      password=mypasswd
      dbname=maildb
      table='t'
      select_field=domains
      where_field=domains
      hosts=127.0.0.1
      additional_conditions = and enabled = 1


      Please help me to understand table='t'. What is 't'?


      TIA


      B.R.
      Stephen L

      Send instant messages to your online friends http://uk.messenger.yahoo.com
    • mouss
      ... there s no t in postfix. if you call your table t , then it s you problem. but it may be time to move to the new syntax (query=)...
      Message 2 of 8 , Dec 1, 2008
      • 0 Attachment
        Stephen Liu a écrit :
        > Hi folks,
        >
        >
        > I have a /etc/postfix/mysql_*.cf file with following content;
        > user=mail
        > password=mypasswd
        > dbname=maildb
        > table='t'
        > select_field=domains
        > where_field=domains
        > hosts=127.0.0.1
        > additional_conditions = and enabled = 1
        >
        >
        > Please help me to understand table='t'. What is 't'?
        >
        >

        there's no 't' in postfix. if you call your table 't', then it's you
        problem.

        but it may be time to move to the new syntax (query=)...
      • Stephen Liu
        ... Hi mouss, Thanks for your advice. I found it on Internet. However it works here. # postfix check without complaint I have been searching around on
        Message 3 of 8 , Dec 1, 2008
        • 0 Attachment
          --- mouss <mouss@...> wrote:

          > Stephen Liu a écrit :
          > > Hi folks,
          > >
          > >
          > > I have a /etc/postfix/mysql_*.cf file with following content;
          > > user=mail
          > > password=mypasswd
          > > dbname=maildb
          > > table='t'
          > > select_field=domains
          > > where_field=domains
          > > hosts=127.0.0.1
          > > additional_conditions = and enabled = 1
          > >
          > >
          > > Please help me to understand table='t'. What is 't'?
          > >
          > >
          >
          > there's no 't' in postfix. if you call your table 't', then it's you
          > problem.


          Hi mouss,


          Thanks for your advice.


          I found it on Internet. However it works here.


          # postfix check
          without complaint


          I have been searching around on table='t' without result.


          > but it may be time to move to the new syntax (query=)...

          Whether you meant replacing;

          table='t'

          with;
          query=
          ???


          I'll try it later. I'm not on that mail server.


          B.R.
          Stephen L


          Send instant messages to your online friends http://uk.messenger.yahoo.com
        • Stephen Liu
          ... Hi mouss, Further to my late posting. Changing; table= t to query= on /etc/postfix/mysql_relay_domains.cf # postfix reload # postfix check # tail
          Message 4 of 8 , Dec 2, 2008
          • 0 Attachment
            --- mouss <mouss@...> wrote:

            > Stephen Liu a écrit :
            > > Hi folks,
            > >
            > >
            > > I have a /etc/postfix/mysql_*.cf file with following content;
            > > user=mail
            > > password=mypasswd
            > > dbname=maildb
            > > table='t'
            > > select_field=domains
            > > where_field=domains
            > > hosts=127.0.0.1
            > > additional_conditions = and enabled = 1
            > >
            > >
            > > Please help me to understand table='t'. What is 't'?
            > >
            > >
            >
            > there's no 't' in postfix. if you call your table 't', then it's you
            > problem.
            >
            > but it may be time to move to the new syntax (query=)...


            Hi mouss,


            Further to my late posting.

            Changing;
            table='t'

            to
            query=


            on /etc/postfix/mysql_relay_domains.cf


            # postfix reload
            # postfix check
            # tail /var/log/mail.log
            ...
            ...
            Dec 2 08:28:27 xen07 postfix/postfix-script: refreshing the Postfix
            mail system
            Dec 2 08:28:27 xen07 postfix/master[2932]: reload configuration
            /etc/postfix
            Dec 2 08:28:27 xen07 postfix/anvil[3363]: statistics: max connection
            rate 1/60s for (smtp:209.85.142.188) at Dec 2 08:26:21
            Dec 2 08:28:27 xen07 postfix/anvil[3363]: statistics: max connection
            count 1 for (smtp:209.85.142.188) at Dec 2 08:26:21
            Dec 2 08:28:27 xen07 postfix/anvil[3363]: statistics: max cache size 4
            at Dec 2 08:26:53
            Dec 2 08:28:47 xen07 postfix/smtpd[3444]: connect from
            host167-240-dynamic.9-79-r.retail.telecomitalia.it[79.9.240.167]


            No error found.


            Sent mails to the routing mail server. All mails were delivered to
            their own mail servers without problem.


            B.R.
            Stephen






            Send instant messages to your online friends http://uk.messenger.yahoo.com
          • Barney Desmond
            ... You haven t told us what this file is called. We dunno what it does, we have no way to tell. ... At a guess, it s going to perform the query: SELECT
            Message 5 of 8 , Dec 2, 2008
            • 0 Attachment
              Stephen Liu wrote:
              > I have a /etc/postfix/mysql_*.cf file with following content;

              You haven't told us what this file is called. We dunno what it does, we
              have no way to tell.

              > user=mail
              > password=mypasswd
              > dbname=maildb
              > table='t'
              > select_field=domains
              > where_field=domains
              > hosts=127.0.0.1
              > additional_conditions = and enabled = 1

              At a guess, it's going to perform the query:
              SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1;

              It could be virtual alias domains, it could be anything.
              http://www.postfix.org/mysql_table.5.html

              > Please help me to understand table='t'. What is 't'?


              As the file says, 't' is the name of the table it's going to SELECT from.
            • Stephen Liu
              ... Hi Barney, Sorry, it is /etc/postfix/mysql_relay_domains.cf ... mysql SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1; ERROR 1064 (42000):
              Message 6 of 8 , Dec 2, 2008
              • 0 Attachment
                --- Barney Desmond <barneydesmond@...> wrote:

                > Stephen Liu wrote:
                > > I have a /etc/postfix/mysql_*.cf file with following content;
                >
                > You haven't told us what this file is called. We dunno what it does,
                > we
                > have no way to tell.


                Hi Barney,


                Sorry, it is /etc/postfix/mysql_relay_domains.cf


                > > user=mail
                > > password=mypasswd
                > > dbname=maildb
                > > table='t'
                > > select_field=domains
                > > where_field=domains
                > > hosts=127.0.0.1
                > > additional_conditions = and enabled = 1
                >
                > At a guess, it's going to perform the query:
                > SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1;


                mysql> SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1;
                ERROR 1064 (42000): You have an error in your SQL syntax; check the
                manual that corresponds to your MySQL server version for the right
                syntax to use near '%s AND `enabled`=1' at line 1


                mysql> SHOW tables;
                +------------------+
                | Tables_in_maildb |
                +------------------+
                | aliases |
                | domains |
                | transport |
                | users |
                +------------------+
                4 rows in set (0.00 sec)


                mysql> SELECT `domains` FROM `trasnport` WHERE `domains`=%s AND
                `enabled`=1;
                ERROR 1064 (42000): You have an error in your SQL syntax; check the
                manual that corresponds to your MySQL server version for the right
                syntax to use near '%s AND `enabled`=1' at line 1


                mysql> SELECT * from transport;
                +------+----------------------+--------------------+-----------+---------+
                | pkid | domain | hostname | transport |
                enabled |
                +------+----------------------+--------------------+-----------+---------+
                | 1 | satimis.dnsalias.com | smtp:192.168.0.209 | :[] |
                1 |
                | 2 | satimis.changeip.net | smtp:192.168.0.208 | :[] |
                1 |
                | 3 | satimis.com | smtp:192.168.0.210 | :[] |
                1 |
                +------+----------------------+--------------------+-----------+---------+
                3 rows in set (0.00 sec)


                mysql> SELECT `domain` FROM `trasnport` WHERE `domain`=%s AND
                `enabled`=1;
                ERROR 1064 (42000): You have an error in your SQL syntax; check the
                manual that corresponds to your MySQL server version for the right
                syntax to use near '%s AND `enabled`=1' at line 1


                mysql> SELECT `domain` FROM `trasnport` WHERE `domains`=%s AND
                `enabled`=1;
                ERROR 1064 (42000): You have an error in your SQL syntax; check the
                manual that corresponds to your MySQL server version for the right
                syntax to use near '%s AND `enabled`=1' at line 1


                Still the same.


                > It could be virtual alias domains, it could be anything.
                > http://www.postfix.org/mysql_table.5.html


                Noted with thanks.



                > > Please help me to understand table='t'. What is 't'?
                >
                >
                > As the file says, 't' is the name of the table it's going to SELECT
                > from.


                But there is no table named 't'. The name of table starts with t is
                'transport'.


                I have changed;

                table='t'

                to;
                query=


                This routing mail server still works without problem.


                B.R.
                Stephen L


                Send instant messages to your online friends http://uk.messenger.yahoo.com
              • Barney Desmond
                ... You need to understand what postfix expects to do. You provide it a mysql query, and it will fill in the blank. Postfix lookups are key-value pairs, so
                Message 7 of 8 , Dec 2, 2008
                • 0 Attachment
                  Stephen Liu wrote:
                  > Sorry, it is /etc/postfix/mysql_relay_domains.cf
                  >
                  >
                  >>> user=mail
                  >>> password=mypasswd
                  >>> dbname=maildb
                  >>> table='t'
                  >>> select_field=domains
                  >>> where_field=domains
                  >>> hosts=127.0.0.1
                  >>> additional_conditions = and enabled = 1
                  >> At a guess, it's going to perform the query:
                  >> SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1;
                  >
                  >
                  > mysql> SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1;
                  > ERROR 1064 (42000): You have an error in your SQL syntax; check the
                  > manual that corresponds to your MySQL server version for the right
                  > syntax to use near '%s AND `enabled`=1' at line 1

                  You need to understand what postfix expects to do. You provide it a
                  mysql query, and it will fill in the blank. Postfix lookups are
                  key-value pairs, so there is exactly one blank to fill in, represented
                  by %s.

                  As a guess, you should check the other tables, maybe `domains`. You're
                  looking for a table with a column called "domains".


                  > I have changed;
                  >
                  > table='t'
                  >
                  > to;
                  > query=
                  >
                  >
                  > This routing mail server still works without problem.

                  This probably just means it won't do that lookup any more, so you won't
                  be accepting mail for the relay_domains that you'd expect.
                • Stephen Liu
                  ... Hi Barney, That line; table= t seems having no function. Whatever I put there; table= t table= query= OR even deleting that line. Other mail servers
                  Message 8 of 8 , Dec 2, 2008
                  • 0 Attachment
                    --- Barney Desmond <barneydesmond@...> wrote:

                    > Stephen Liu wrote:
                    > > Sorry, it is /etc/postfix/mysql_relay_domains.cf
                    > >
                    > >
                    > >>> user=mail
                    > >>> password=mypasswd
                    > >>> dbname=maildb
                    > >>> table='t'
                    > >>> select_field=domains
                    > >>> where_field=domains
                    > >>> hosts=127.0.0.1
                    > >>> additional_conditions = and enabled = 1
                    > >> At a guess, it's going to perform the query:
                    > >> SELECT `domains` FROM `t` WHERE `domains`=%s AND `enabled`=1;
                    > >
                    > >
                    > > mysql> SELECT `domains` FROM `t` WHERE `domains`=%s AND
                    > `enabled`=1;
                    > > ERROR 1064 (42000): You have an error in your SQL syntax; check the
                    > > manual that corresponds to your MySQL server version for the right
                    > > syntax to use near '%s AND `enabled`=1' at line 1
                    >
                    > You need to understand what postfix expects to do. You provide it a
                    > mysql query, and it will fill in the blank. Postfix lookups are
                    > key-value pairs, so there is exactly one blank to fill in,
                    > represented
                    > by %s.
                    >
                    > As a guess, you should check the other tables, maybe `domains`.
                    > You're
                    > looking for a table with a column called "domains".
                    >
                    >
                    > > I have changed;
                    > >
                    > > table='t'
                    > >
                    > > to;
                    > > query=
                    > >
                    > >
                    > > This routing mail server still works without problem.
                    >
                    > This probably just means it won't do that lookup any more, so you
                    > won't
                    > be accepting mail for the relay_domains that you'd expect.


                    Hi Barney,


                    That line;
                    table='t'

                    seems having no function.


                    Whatever I put there;

                    table='t'
                    table=
                    query=


                    OR even deleting that line. Other mail servers receive mails without
                    problem. All incoming mails were routed to their mail servers
                    according to domains.


                    Remark: each time after editing /etc/postfix/mysql_relay_domains.cf

                    ran;
                    # postfix reload
                    # postfix check
                    # tail /var/log/mail.log

                    to make sure no error/warning popup


                    Stephen L


                    Send instant messages to your online friends http://uk.messenger.yahoo.com
                  Your message has been successfully submitted and would be delivered to recipients shortly.