postfix error
mysql won't work correctly with postfix...in the logfiles i see this error:
Code:
warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) |
Your mysql server isn't running or the permission on the socket aren't setup properly.
|
the socket is working i think, because phpmyadmin is working properly...
maybe its because postfix is chroot-ed? |
Uhm, yes, it's because postfix is chrooted. These little bits of information upfront make trouble shooting a lot easier. The socket lives outside the jail so there's no way the process can see it. You need to stop the chrooted processes and move the socket into the jail. Then reload posfix. If you need more advice post the output of postconf -n and also your master.cf file.
|
postconf -n output:
Code:
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix inet_interfaces = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = CasServer.cashosting.nl, localhost.cashosting.nl, , localhost myhostname = CasServer.cashosting.nl mynetworks = 127.0.0.0/8 myorigin = /etc/mailname recipient_delimiter = + relayhost = mail.planet.nl smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_tls_cert_file = /etc/postfix/smtpd.cert smtpd_tls_key_file = /etc/postfix/smtpd.key smtpd_use_tls = yes virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf mysql:/etc/postfix/mysql-virtual_email2email.cf virtual_gid_maps = static:5000 virtual_mailbox_base = /home/vmail virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf virtual_uid_maps = static:5000 Code:
# |
I'm not gonna read the postconf -n output as long as it's one single line of text.
What makes you think your postfix runs chroot'ed? |
is this good?
Code:
alias_database = hash:/etc/aliases |
Ok, none of the postfix processes are running chroot'ed as you can see from the master.cf file. So the problem is with mysql. Check the postfix mysql files mysql-virtual*.cf for database hostname, username and password and make sure you can connect to the database. Simulate the lookups you want postfix to perform and see what happens:
for instance: postconf -q <lookupkey> mysql:/etc/postfix/mysql-virtual_domains.cf also try connecting to the database as the postfix database user: mysql -u <postfix database user> -p<postfix database password> <postfix database> Check the mysql socket: Does it exist (is mysql running) what are the permissions? |
mm, if i connect with 'mysq' it goes without problems.
mysql.sock exists, mysql is running and the permissions are 755 |
Sorry, I had a typo in my last post. The lookup command is, of course, postmap -q ... Try it! Say one of your mysql tables holds the mailbox location for each mail user. Then this command does the lookup postfix would usually do during runtime:
postmap -q demian mysql:/etc/postfix/mysql-virtual_mailbox.cf This should return something like /home/vmail/demian or nothing at all if the lookup fails. Obviously you will need to adjust the parameters to fit your database. |
All times are GMT -5. The time now is 06:31 AM. |