Carlos Williams wrote: > In my attempt to block my Postfix email server from receiving and > sending email to gmail, yahoo, hotmail, aol, and msn email accounts, I > created the following: > > vim /etc/postfix/main.cf >
We prefer 'postconf -n' for a good reason. It shows you (most times) what Postfix is using > smtpd_sender_restrictions = hash:/etc/postfix/access > reject_unauth_destination = hash:/etc/postfix/access > That last line does nothing except set an unknown variable. > Then I created the file called 'access' and added the following entry: > > vim /etc/postfix/access > > gmail.com REJECT > > The problem I have is nobody from the specific domains are able to > send email to my mail server. It rejects like it should however I am > still able to send mail to those domains from my Postfix email server. > It appears that 1/2 of the rule is working and I don't know what I did > wrong. > > Anyone know? > > I checked /var/log/mail.err and found nothing. > > Nov 21 14:17:26 mail postfix/smtpd[5425]: NOQUEUE: reject: RCPT from > yx-out-1718.google.com[74.125.44.157]: 554 5.7.1 > <[EMAIL PROTECTED]>: Sender address rejected: Access denied; > from=<[EMAIL PROTECTED]> to=<[EMAIL PROTECTED]> proto=ESMTP > helo=<yx-out-1718.google.com> > > Inbound = blocked > Outbound = still works > > Why? > Outbound may come in several different ways, if via pickup (sendmail command) smtpd restrictions will not help. If it does come in via smtpd you may do: smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access, permit_mynetworks, reject_unauth_destination (... more checks if required) *WARNING* do NOT list an OK in the /etc/postmap/access file or you will be an Open Relay. Brian
