Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th March 2006, 22:52
epo epo is offline
Junior Member
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default postfix - MySQL connection problem

Hello y'all,

I'm having some trouble getting postfix to work with mysql. I started out
using the tutorial at http://workaround.org/articles/ispmail-sarge/.
To test the MySQL connection I tried:
postmap -v -q "test" mysql:/etc/postfix/mysql-virtual-forwardings.cf
Output:
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf: user = postfix
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf: password = xxx
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf: dbname =
provider
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf: table =
forwardings
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf:
select_field = destination
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf: where_field
= source
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf:
additional_conditions =
postmap: cfg_get_str: /etc/postfix/mysql-virtual-forwardings.cf: hosts =
127.0.0.1
postmap: mysqlname_parse: /etc/postfix/mysql-virtual-forwardings.cf: adding
host '127.0.0.1' to list of mysql server hosts
postmap: dict_open: mysql:/etc/postfix/mysql-virtual-forwardings.cf
postmap: dict_mysql_lookup using sql query: select destination from
forwardings where source = 'test'
postmap: dict_mysql_get_active: attempting to connect to host 127.0.0.1
postmap: warning: connect to mysql server 127.0.0.1: Lost connection to
MySQL server during query

I've switched on logging on my mysql server, but no relevant logs show up.
I was surprised that postmap indicates a connection has been made (although
lost shortly after), but mysql doesn't seem to have recieved (or logged)
this attempt.

I'm running Debian 2.6.15.3
Software packages:
mysql-server 4.0.24-10sarge1
postfix 2.1.5-9

Anyone interested in solving this one? It would shurely make my day!

Thanks,
Philip
Reply With Quote
Sponsored Links
  #2  
Old 13th March 2006, 23:10
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Please post the output of
Code:
netstat -tap
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 13th March 2006, 23:27
epo epo is offline
Junior Member
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thans for the quick reply.

# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost.localdo:mysql *:* LISTEN 1618/mysqld
tcp 0 0 *:smtp *:* LISTEN 2250/master
tcp6 0 0 *:imaps *:* LISTEN 1559/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 1524/couriertcpd
tcp6 0 0 *:ssh *:* LISTEN 1761/sshd
tcp6 0 0 *:smtp *:* LISTEN 2250/master

The mysql server is listening to the correct port, but I just noticed I can't telnet to it:
# telnet 127.0.0.1 3306
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.

Is there some mysql configuration I've missed?

Cheers,
Philip
Reply With Quote
  #4  
Old 14th March 2006, 00:01
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

What's in /etc/hosts and /etc/mysql/my.cnf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 14th March 2006, 00:11
epo epo is offline
Junior Member
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It looks like I had a misconfiguration in my hosts.allow settings.
Adding an entry for mysql solved the problem:
mysqld: 127.0.0.1

Thanks for your clue to pinpoint the problem.
Philip
Reply With Quote
  #6  
Old 3rd August 2006, 17:28
b_52globemaster b_52globemaster is offline
Junior Member
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default hi

i have nearly the same problem

in the logs :

Aug 3 15:24:49 mail postfix/trivial-rewrite[6684]: fatal: mysql:/etc/postfix/mysql-virtual_mailboxes.cf(0,100): table lookup problem
Aug 3 15:25:50 mail postfix/trivial-rewrite[6690]: fatal: mysql:/etc/postfix/mysql-virtual_mailboxes.cf(0,100): table lookup problem

i put
mysqld: 127.0.0.1
mail:/var/log#

in my /etc/hosts.allow

but the problem still here .



thanks in advance
Reply With Quote
  #7  
Old 4th August 2006, 13:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

What's in /etc/postfix/mysql-virtual_mailboxes.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 4th August 2006, 20:49
b_52globemaster b_52globemaster is offline
Junior Member
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

thanks falko

finally the problem is resolved , and as you suspect it was a grammar syntax error in the sql query in
/etc/postfix/mysql-virtual_mailboxes.cf

and thanks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Virtual Users And Domains With Postfix, Courier And MySQL Howto fenix Server Operation 4 11th March 2006 02:53
Another Problem: Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP bluegrass Installation/Configuration 24 8th March 2006 01:41
virtual users postfix mysql how-to problem Yoblad HOWTO-Related Questions 1 25th February 2006 05:42
MySQL connection problem cartdev Installation/Configuration 17 17th November 2005 22:30
Problem installing ISPConfig, then with MySQL... ctroyp Installation/Configuration 7 26th September 2005 16:37


All times are GMT +2. The time now is 23:33.


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