I've got a mailserver with Postfix, Dovecot,
saslauthd and a MySQL storage and auth backend. I can send emails just fine, however receiving emails (from Outlook in this case) fails with messages in
The MySQL log shows these errors:
53 Connect mail@localhost on mail 53 Connect Access denied for user 'mail'@'localhost' (using password: YES) 54 Connect mail@localhost on mail 54 Connect Access denied for user 'mail'@'localhost' (using password: YES) 55 Connect mail@localhost on mail 55 Connect Access denied for user 'mail'@'localhost' (using password: YES) 56 Connect mail@localhost on mail 56 Connect Access denied for user 'mail'@'localhost' (using password: YES)
It appears I can't log in to the MySQL server, however, when I do
mysql -u mail -p -h localhost
I can log in fine. The password is known to be correct in both cases.
I have a feeling that this is all caused by Postfix (and subsequently SMTPD I think?) being run in a
chroot jail in
/var/spool/postfix. I've tried disabling chroot and mounting
mysql.sock to a folder in the Postfic chroot, however nothing changes.
I've also tried changing instances of
localhost and vice versa to no avail. Google has been sapped dry by my attempts to find a solution. Maybe I'm searching for the wrong thing.
What do I need to do to allow Postfix to access a MySQL database running on the same server? I want to use MySQL for other things like PHP, so a Postfix-exclusive solution isn't really an option. This has been troubling me for a good 3 days now and I've attempted all the solutions out there.
/etc/postfix/sasl/smtpd.conf looks like this:
pwcheck_method: auxprop mech_list: PLAIN LOGIN log_level: 7 allow_plaintext: true auxprop_plugin: sql sql_engine: mysql sql_hostnames: localhost sql_user: mail sql_passwd: [hidden] sql_database: mail sql_select: select password from mailbox where username='%u@%r' and active = 1
I'm unsure what other files to post, so please comment and I will update accordingly. I'm running Ubuntu Server 12.10 32 bit.