Postmap: fatal: open database /etc/postfix/sasl_passwd.db: Permission denied

gmailpostfix

I'm configuring Postfix to use external smtp. For this, I used this tutorial

After following it, I found in the logs that /etc/postfix/sasl_passwd.db couldn't be read. The file didn't exist. I used postmap hash:/etc/postfix/sasl_passwd (http://postfix.state-of-mind.de/patrick.koetter/smtpauth/smtp_auth_mailservers.html) as root, but I get:

postmap: fatal: open database /etc/postfix/sasl_passwd.db: Permission denied

Why do I get this?

OS: Fedora 14
User "postfix" exists.

Update:

sudo ls -l /etc/postfix/sasl_passwd.db ls:

cannot access /etc/postfix/sasl_passwd.db: No such file or directory

touch /etc/postfix/sasl_passwd.db
chmod 640 /etc/postfix/sasl_passwd.db
chown postfix:root /etc/postfix/sasl_passwd.db

sudo ls -l /etc/postfix/sasl_passwd.db

-rwxr--r--. 1 postfix root 0 Feb 19 04:16 /etc/postfix/sasl_passwd.db
-rw-r-----. 1 postfix root 0 Feb 19 04:16 /etc/postfix/sasl_passwd.db

postmap hash:/etc/postfix/sasl_passwd

postmap: fatal: cannot remove zero-length database file /etc/postfix/sasl_passwd.db: Permission denied.

chmod 777 gives the same error as above.

Best Answer

You need to make sure that postfix user is able to read that file. You can post the output of $ sudo ls -l /etc/postfix/sasl_passwd.db to get more help.

To create this file, you can use the command:

$ sudo postmap sasl_passwd

This will create the .db file.