Hi,
I've been following the guide on "Handling Multiple Domains with Postfix Admin in RHEL/CentOS5" but got stuck at step 3 of configuring Postfix.
When I executed the command "postmap -q localhost mysql:/etc/postfix/mysql-domains.cf", it gave me the following:
postmap: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
I read on some site that postfix runs chrooted so I need to create hardlinks for it to be able to reach mysql.sock, so I added the following in /etc/my.cnf in 'start':
if [ -e /var/lib/mysql/mysql.sock ]; then
if [ -e /var/spool/postfix/var/lib/mysql/mysql.sock ]; then
rm /var/spool/postfix/var/lib/mysql/mysql.sock
fi
mkdir -p /var/spool/postfix/var/lib/mysql
chown mysql /var/spool/postfix/var/lib/mysql
ln /var/lib/mysql/mysql.sock /var/spool/postfix/var/lib/mysql/mysql.sock
fi
I'm assuming that this will create the hardlink required everytime I restart mysqld. Problem is, it is still giving me the "Can't connect to local MySQL server through socket" warning.
I've been searching for a solution for days now but no luck. Hope someone can shed some light on the problem I'm facing. By th way, I havent configured anything of postfix except adding the mysql-domains.cf file as instructed in the guide.