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

Wed Oct 5 08:44:58 UTC 2011
Alexander Farber <alexander.farber at gmail.com>

Thanks Craig for your comments.

I've got my sendmail on CentOS 6 working with:

# yum erase postfix
# yum install sendmail sendmail-cf

# mkdir /etc/mail/auth
# chmod 700 /etc/mail/auth
# mkdir /etc/mail/certs
# chmod 700 /etc/mail/certs

Create the file /etc/mail/auth/client-info:

AuthInfo:smtp.gmail.com "U:smmsp" "I:Alexander.Farber" "P:XXX" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:smmsp" "I:Alexander.Farber" "P:XXX" "M:PLAIN"

# cd /etc/mail/auth
# makemap -r hash client-info.db < client-info

# cd /etc/mail/certs
# openssl dsaparam 1024 -out dsa1024.pem
# openssl req -x509 -nodes -days 3650 -newkey dsa:dsa1024.pem -out
/etc/mail/certs/mycert.pem -keyout /etc/mail/certs/mykey.pem
# ln -s /etc/mail/certs/mycert.pem /etc/mail/certs/CAcert.pem
# rm dsa1024.pem
# chmod 400 *.pem

Added to file /etc/mail/sendmail.mc:

define(`SMART_HOST', `smtp.gmail.com')dnl

define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/CAcert.pem')
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')

Then "make" in /etc/mail and "service sendmail restart"

I understand your point that it is stupid of me (and probably
many other users) to ask same questions again and
again, without really understanding what's going on :-)

The file /etc/pki/tls/misc/CA.pl on CentOS is cubersome
to understand though. I tried creating ./CA.pl -newca etc.
but then I wanted to start over because of an invalid
input made by myself and I didn't even know how.

I know CA.pl keeps a text file somewhere where it
stores increasing integer numbers... but couldn't find it

Regards
Alex