From: Jerim79 on
This may not be the proper group to post this in, but the other group
never repsonded. I am trying to get check_recipient_maps enabled. I
have found some general guides, but nothing that is a step by step, all
encompassing guide. What I believe is that all I need is this one line:

check_recipient_maps hash:/etc/postfix/(name of file containing
valid email addresses)

If that is all there is to it, please let me know. If there is more to
it, please let me know. I am just trying to get Postfix to verify the
recipient against a list of valid email addresses and reject anything
to a user not on the list.

From: Greg Hackney on
Jerim79 wrote:
> This may not be the proper group to post this in, but the other group
> never repsonded. I am trying to get check_recipient_maps enabled. I
> have found some general guides, but nothing that is a step by step, all
> encompassing guide. What I believe is that all I need is this one line:
>
> check_recipient_maps hash:/etc/postfix/(name of file containing
> valid email addresses)
>
> If that is all there is to it, please let me know. If there is more to
> it, please let me know. I am just trying to get Postfix to verify the
> recipient against a list of valid email addresses and reject anything
> to a user not on the list.

check_recipient_maps is not a stand-alone configuration; it needs to go
underneath some smtpd restriction, the most common one being
smtpd_recipient_restrictions.

Mine looks like this:


smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/recipients,
reject_non_fqdn_recipient,
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_unknown_recipient_domain

The access file that you create, for example
/etc/postfix/recipients, is most commonly a hashed
database file. The file format is to put all the OK's
at the top, and the REJECT's at the bottom (the file
is parsed top to bottom):

abuse(a)mydomain.com OK
postmaster(a)mydomain.com OK
suspect(a)mydomain.com HOLD
@prohibited_domain.com REJECT
reporter(a)newspaper.com REJECT

Every time the file is changed, it's corresponding
database file must be created, with:
postmap /etc/postfix/recipients

It creates a file named /etc/postfix/recipients.db

The to make sure the changes take affect immediately
rather than automatically some point in the future,
run the command "postfix reload".

The best overall reference is "man 5 postconf".
--
Greg