On Tue, Nov 16, 2021 at 05:55:03PM -0500, Ruben Safir <ru...@mrbrklyn.com> wrote:
> I got an email from cpa...@mrbrklyn.com which is not from > us, as we are mrbrklyn.com > > How do I block email with this on the From line > > >From cpa...@mrbrklyn.com Tue Nov 16 03:59:34 2021 I think the simplest approach to reject mail that falsely claims to be from you is to use the smtpd_sender_restrictions parameter and check_sender_access. e.g.: In /etc/postfix/main.cf: smtpd_sender_restrictions = permit_mynetworks permit_sasl_authenticated check_sender_access pcre:/etc/postfix/sender-access permit In /etc/postfix/sender-access: /mrbrklyn\.com/ REJECT Test it with: postmap -q cpa...@mrbrklyn.com pcre:/etc/postfix/sender-access And then test that you can still send yourself an email! :-) This only applies the check for email that isn't coming from your own networks/users. If you don't have/want PCRE installed, you can replace "pcre:" with "regexp:" (but it's slower). Alternatively, you can set up SPF/DKIM/DMARC or rspamd. There's more work involved, but it might help others if anyone else is receiving mail that claims to be from you. But it might just be your domain receiving those emails. cheers, raf