I have a standard Postfix server on one of my servers and I have not set up anything so far. What I wish to achieve is: In a MySQL database I want to store email addresses that are accepted by Postfix. Everything else should be rejected.
I've read a lot of "HOWTO"s but now I'm getting very confused about it. The steps are ??
Create a database with a table containing id, address, status (like 1,firstname.lastname@example.org,OK)
Create a cfg file in /etc/postfix to tell theDB connection details + a query something like: select status from users where address='%s' (What is %s BTW??? )
Add to main.cfg the following: smtpd_recipient_restrictions = check_recipient_access mysql:/etc/postfix/mysql-recipient-access.cf
Restart postfix and viola....
Not the last part, the "voila" isn't doing it for me. What did I get wrong in this idea?
I always get the following back:
Mar 25 12:46:40 myserver postfix/local: 6D1C88XXX: to=<email@example.com>, relay=local, delay=0.21, delays=0.15/0.03/0/0.02, dsn=5.1.1, status=bounced (unknown user: "anyone")
While in the DB I have a row with:
id:1, address:firstname.lastname@example.org, status:OK