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.

-- 
    Viktor.

Reply via email to