HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   Problems with postfix-mysql (http://www.howtoforge.com/forums/showthread.php?t=1149)

Pelle 6th November 2005 14:26

Problems with postfix-mysql
 
I have followered the tut:
http://howtoforge.com/virtual_postfi..._quota_courier

I finished the tutorial with no problems, now I'm trying to test the mail system by sending a mail to a given email I have put in to the database!

It looks like there are severel problems, but the first is that postfix can not access the mysql database?

syslog:
Code:

Nov  6 05:22:44 houston2 postfix/smtpd[32212]: connect from xproxy.gmail.com[66.249.82.199]
Nov  6 05:22:45 houston2 postfix/proxymap[32213]: warning: connect to mysql server 127.0.0.1: #HY000Host 'gmlitconsultis' is not allowed to connect to this MySQL server
Nov  6 05:22:45 houston2 postfix/proxymap[32213]: warning: connect to mysql server 127.0.0.1: #HY000Host 'gmlitconsultis' is not allowed to connect to this MySQL server
Nov  6 05:22:45 houston2 postfix/trivial-rewrite[32214]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
Nov  6 05:22:46 houston2 postfix/smtpd[32212]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

How can I solve this, Have tried looking for solutions for the connect problem (found this http://forums.mysql.com/read.php?86,...3619#msg-23619 ) but dosent help, because the solution there was to create the database user, but I have.. and the password is correct!

Then the next problem I think I have a solution for:
Code:

/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
If I look at this file then

Code:

user = mail_admin
password = mail_admin_password
dbname = mail
table = domains
select_field = 'virtual'
where_field = domain
hosts = 127.0.0.1

but in this table, 'virtual' dosent exist only the collumm "domain" do.
Should this bee domain instead?

falko 6th November 2005 14:42

The table lookup problem is resulting from the problem that your user is not allowed to connect to the MySQL database.

Did you grant the correct privileges to that user? Did you run
Code:

FLUSH PRIVILEGES;
afterwards? This is important because the changes become valid only after that command.

Pelle 6th November 2005 17:33

Yes I used FLUSH PRIVILEGES;

Did it again... But no change...

I tried to logon with the user and pass from the console and it worked
Code:

houston2:/etc/postfix# mysql -u pureftpd -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3847 to server version: 4.1.11-Debian_4sarge2-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;


Pelle 6th November 2005 17:44

Again I have tried to change the hosts with the domain for the server in mysql-*.cf files

Code:

Nov  6 08:59:49 houston2 postfix/smtpd[1462]: connect from zproxy.gmail.com[64.233.162.202]
Nov  6 08:59:49 houston2 postfix/proxymap[1463]: warning: connect to mysql server houston2.ustabilserverplads.dk: Can't connect to MySQL server on 'houston2.ustabilserverplads.dk' (111)
Nov  6 08:59:49 houston2 postfix/proxymap[1463]: warning: connect to mysql server houston2.ustabilserverplads.dk: Can't connect to MySQL server on 'houston2.ustabilserverplads.dk' (111)
Nov  6 08:59:49 houston2 postfix/trivial-rewrite[1464]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
Nov  6 08:59:50 houston2 postfix/smtpd[1462]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Nov  6 08:59:50 houston2 postfix/smtpd[1462]: warning: problem talking to service rewrite: Success
Nov  6 08:59:50 houston2 postfix/master[1458]: warning: process /usr/lib/postfix/trivial-rewrite pid 1464 exit status 1
Nov  6 08:59:51 houston2 postfix/trivial-rewrite[1465]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
Nov  6 08:59:52 houston2 postfix/smtpd[1462]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Nov  6 08:59:52 houston2 postfix/smtpd[1462]: warning: problem talking to service rewrite: Success
Nov  6 08:59:52 houston2 postfix/master[1458]: warning: process /usr/lib/postfix/trivial-rewrite pid 1465 exit status 1
Nov  6 08:59:52 houston2 postfix/master[1458]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

any idea?


I have pureftpd-mysql using the same database, and here there is no problem for this to use the mysql!

falko 6th November 2005 18:51

From your log file I see that Postfix tries to connect to MySQL on houston2.ustabilserverplads.dk instead of 127.0.0.1. So either you allow remote connections to that MySQL user, or you change the configuration so that Postfix tries to connect on 127.0.0.1.

Pelle 6th November 2005 20:42

Forgot to mention that I changed the hosts on purpose, to see if it will make anydifferens!

But no, the same log file is being written just with 127.0.0.1 instead of houston2.ustabilserverplads.dk and still having problems.

falko 7th November 2005 10:30

Please post the output of
Code:

netstat -tap

Pelle 7th November 2005 17:18

Here:

Code:

        Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name
tcp        0      0 *:imaps                *:*                    LISTEN    20482/couriertcpd
tcp        0      0 *:tcpmux                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:20034                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:pop3s                *:*                    LISTEN    20393/couriertcpd
tcp        0      0 *:32771                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:32772                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:40421                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:32773                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:32774                *:*                    LISTEN    13755/portsentry
tcp        0      0 houston2.ustabils:10024 *:*                    LISTEN    18883/amavisd (mast
tcp        0      0 houston2.ustabils:10025 *:*                    LISTEN    27690/master
tcp        0      0 *:31337                *:*                    LISTEN    13755/portsentry
tcp        0      0 houston2.ustabils:mysql *:*                    LISTEN    15027/mysqld
tcp        0      0 *:ircd                  *:*                    LISTEN    13755/portsentry
tcp        0      0 *:systat                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:pop3                  *:*                    LISTEN    30180/couriertcpd
tcp        0      0 *:5742                  *:*                    LISTEN    13755/portsentry
tcp        0      0 *:imap2                *:*                    LISTEN    30164/couriertcpd
tcp        0      0 *:sunrpc                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:finger                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:netstat              *:*                    LISTEN    13755/portsentry
tcp        0      0 *:www                  *:*                    LISTEN    970/apache2
tcp        0      0 *:54320                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:sieve                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:27665                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:ingreslock            *:*                    LISTEN    13755/portsentry
tcp        0      0 *:ftp                  *:*                    LISTEN    20841/pure-ftpd (SE
tcp        0      0 170.70-86-143.re:domain *:*                    LISTEN    7263/named
tcp        0      0 houston2.ustabil:domain *:*                    LISTEN    7263/named
tcp        0      0 *:ssh                  *:*                    LISTEN    1435/sshd
tcp        0      0 *:nntp                  *:*                    LISTEN    13755/portsentry
tcp        0      0 *:socks                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:smtp                  *:*                    LISTEN    27690/master
tcp        0      0 *:12345                *:*                    LISTEN    13755/portsentry
tcp        0      0 houston2.ustabilser:953 *:*                    LISTEN    7263/named
tcp        0      0 *:12346                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:https                *:*                    LISTEN    970/apache2
tcp        0      0 *:635                  *:*                    LISTEN    13755/portsentry
tcp        0      0 *:49724                *:*                    LISTEN    13755/portsentry
tcp        0      0 *:uucp                  *:*                    LISTEN    13755/portsentry
tcp        0  4096 170.70-86-143.rever:ssh port363.ds1-abc.a:10846 ESTABLISHED27449/1
tcp        0      0 170.70-86-143.rever:ssh port363.ds1-abc.a:10845 ESTABLISHED27447/0


falko 7th November 2005 18:00

Ok, and what's in /etc/mysql/my.cnf?

Pelle 7th November 2005 18:21

Code:

[client]
port                = 3306
socket                = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket                = /var/run/mysqld/mysqld.sock
nice                = 0

[mysqld]
#
# * Basic Settings
#
user                = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket                = /var/run/mysqld/mysqld.sock
port                = 3306
basedir                = /usr
datadir                = /var/lib/mysql
tmpdir                = /tmp
language        = /usr/share/mysql/english
skip-external-locking
#
# For compatibility to other Debian packages that still use
# libmysqlclient10 and libmysqlclient12.
old_passwords        = 1
#
# localhost which is more compatible and is not less secure.
bind-address                = 127.0.0.1
#
# * Fine Tuning
#
key_buffer                = 16M
max_allowed_packet        = 16M
thread_stack                = 128K
#
# * Query Cache Configuration
#
query_cache_limit        = 1048576
query_cache_size        = 16777216
query_cache_type        = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log                = /var/log/mysql.log
#log                = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log-slow-queries        = /var/log/mysql/mysql-slow.log
#
# The following can be used as easy to replay backup logs or for replication.
#server-id                = 1
log-bin                        = /var/log/mysql/mysql-bin.log
# See /etc/mysql/debian-log-rotate.conf for the number of files kept.
max_binlog_size        = 104857600
#binlog-do-db                = include_database_name
#binlog-ignore-db        = include_database_name
#
# * BerkeleyDB
#
# According to an MySQL employee the use of BerkeleyDB is now discouraged
# and support for it will probably cease in the next versions.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# If you want to enable SSL support (recommended) read the manual or my
# HOWTO in /usr/share/doc/mysql-server/SSL-MINI-HOWTO.txt.gz
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet        = 16M

[mysql]
#no-auto-rehash        # faster start of mysql but no tab completition

[isamchk]
key_buffer                = 16M



All times are GMT +2. The time now is 22:34.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.