On 2/8/2023 4:14 AM, Viktor Dukhovni wrote:
On Wed, Feb 08, 2023 at 10:00:14AM +0200, mailm...@ionos.gr wrote:

/\.top$/ REJECT
/\.xyz$/ REJECT
/\.cam$/ REJECT
/\.fun$/ REJECT
/\.buzz$/ REJECT
/\.club$/ REJECT
/\.link$/ REJECT
/\.hinet\.net$/ REJECT
Why everyone feels they need regular expressions for this is a mystery.

     /etc/postfix/sender-access:
         top     REJECT I employ crude anti-spam measures
         .top    REJECT I employ crude anti-spam measures
         cam     REJECT I employ crude anti-spam measures
         .cam    REJECT I employ crude anti-spam measures
         ...

     main.cf:
         texthash = texthash:${config_directory}/
         smtpd_sender_restrictions =
             check_sender_access ${texthash}sender-access

or directly in main.cf:

     main.cf:
         smtpd_sender_restrictions =
             check_sender_access inline:{
               { top   = REJECT I employ crude anti-spam measures }
               { .top  = REJECT I employ crude anti-spam measures }
               { cam   = REJECT I employ crude anti-spam measures }
               { .cam  = REJECT I employ crude anti-spam measures } }

or an indexed table (with same sender-access file, after "postmap"):

     main.cf:
         # "cdb" is better when available
         default_database_type = hash
         indexed = ${default_database_type}:${config_directory}/
         smtpd_sender_restrictions =
             check_sender_access ${indexed}sender-access

Whatever you choose, regular expressions should last or on your list, or
not at all.  A very small fraction of mortals are capable of using
regular expressions correctly.


Thanks for everyone who has responded. This (directly in main.cf) appears to be the answer that works for me and is much simpler.

I tried the suggested regexp before this one and still got the same error.

The error was:
FebĀ  8 07:38:11 mailserver postfix/smtpd[446839]: NOQUEUE: reject: RCPT from mail-qt1-f179.google.com[209.85.160.179]: 451 4.3.5 Server configuration error; from=<myusern...@gmail.com> to=<j...@obrien-pifer.com> proto=ESMTP helo=<mail-qt1-f179.google.com>

Reply via email to