On Sep 26, 2019, at 4:01 AM, Dominic Raferd <[email protected]> wrote:
> Of course this assumes pcre (or maybe regex) file. To ensure it picks
> up only email addresses in From header (and not text), then, using
> pcre file for header_checks:

No, you do the checks for the helo, not the From: header.

The idea is to drop the connection as soon as possible, as cheaply as possible.

 check_helo_access pcre:/etc/postfix/helo_checks.pcre

# Specifric domain exceptions
/goodserver\.fm$/ DUNNO
/\.goodserver\.fm$/ DUNNO
/allowed\.social$/ DUNNO
/\.allowed\.social$/ DUNNO
/bad.com/ 550 Mail from bad.com not wanted
/\.bad.com/ 550 Mail from bad.com not wanted

#general
/.*\.(com|net|org|edu|gov|ca|mx|de|dk|fr|fi|uk|us|tv|info|biz|eu|es|il|it|nl|name|jp|host|au|nz|ch|tv)$/
 DUNNO
/.*\.*$/ 550 Mail to or from this TLD is not allowed

Of course, the list of domains to accept mail from is up to you, but these work 
for me. I am considering adding .fm to my allowed list as I haven’t seen much 
spam from it for quite awhile.



-- 
Footnote on the High Energy Magic building: It was here that the thaum,
hitherto believed to be the smallest possible particle of magic, was
successfully demonstrated to be made up of resons (lit: 'Thing-ies) or
reality fragments. Currently research indicates that each reson is
itself made up of a combination of at least five 'flavours', known as
'up', 'down', 'sideways', 'sex appeal' and 'peppermint’.

Reply via email to