On Fri, 16 Nov 2018 at 05:18, Dennis Carr <dennistheti...@chez-vrolet.net> wrote:
> Heya. Postfix 3.1.8 on Debian Stable. > > I'm trying to use /etc/postfix/sender_access to pretty much reject > anything showing as 'From: *@qq.com' as there's a plethora of spam > coming from that domain - and it's not rejecting. Suffice it to say, I > seem to be doing it wrong. > > In sender_access, I have: > > \/.qq.com$/ REJECT > > ...and the reference to this file in main.cf is: > > smtpd_sender_restrictions = > check_sender_access hash:/etc/postfix/sender_access, > ... > > ...what'd I miss? > > If needed I can stick the files up on a pastebin. > I'm afraid there are several mistakes here: - you say you want to ban based on the 'From:' address which if true would require you to use header_checks ( http://www.postfix.org/header_checks.5.html) not sender_access - you are using a 'hash' table in main.cf but have put regex (or pcre) format in your table - the regex contains errors I think you actually want to reject based on the envelope sender (not From header), in which case you want main.cf unchanged and sender_access like: qq.com REJECT Then do 'postmap /etc/postfix/sender_access' to create the sender_access.db file which is what postfix will be looking for.