Justin Peavey: > > Thanks for the reply, unfortunately the approach doesn?t seem to work for me. > It appears that that the regardless of the smtp_recipient_restrictions > setting, that any addresses listed in /etc/aliases addressed to $mydomain is > bypassing any blocking/filtering. Is this expected behavior? >
Your observation is flawed, or you made a mistake. The filter below does not distinguish between recipient domains. Wietse > > > >> On Dec 10, 2017, at 4:22 PM, Wietse Venema <wie...@porcupine.org> wrote: > >> > >> Omniver: > >>> I have a mail server receiving internet mail for my primary domain and > >>> for a > >>> few virtual domains. I'm having some spam issues with internet mail > >>> coming > >>> in for address@mydomain for addresses intended for use by local > >>> tools/scripts which are listed in /etc/aliases. Any ideas on how can I > >>> make > >>> it that postfix accepts mail for these addressesI *only* if they were sent > >>> by my mail server? > >> > >> A crude but simple solution: > >> > >> - Add the server's IP address to Postfix mynetworks. > >> > >> - Block some recipients if mail does not come from mynetworks: > >> > >> /etc/postfix/main.cf: > >> smtpd_recipient_restrictions = > >> permit_mynetworks > >> check_recipient_access hash:/etc/postfix/recipient_access > >> ... > >> reject_unauth_destination > >> ... > >> > >> /etc/postfix/recipient_access > >> us...@example.com reject > >> us...@example.com reject > >> > >> Crude because it adds the server to mynetworks. > >> > >> Wietse > > > >