Blacklist question

Discussion in 'Server Operation' started by bigmatlem, Feb 13, 2021.

  1. bigmatlem

    bigmatlem Member

    I'd like to black list an entire .domain rather than
    I'm trying @*.domain to catch the spammers for example .today, .buzz, etc. Will with work that way?
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. MaxT

    MaxT Member HowtoForge Supporter

    to block an entire TLD like .pro, .bid,.top, etc...

    create one -pcre file, in example reject_domains.pcre and put the desired tld domains inside:
    # nano /etc/postfix/reject_domains.pcre
    /\.top$/ DISCARD
    /\.pro$/ DISCARD
    /\.business$/ DISCARD
    /\.br$/ REJECT Sorry, temporarily rejected TLD .BR because spam
    you can see the difference in the last line: if you wish to give an explanation to the sender for some temporary situation, then use REJECT, and at the end of that same line you can write some explanation about that specific domain.

    Save and exit.

    Now edit /etc/postfix/ and search the smtpd_sender_restrictions section to include this line:
    # nano /etc/postfix/
    smtpd_sender_restrictions =
    check_sender_access pcre:/etc/postfix/reject_domains.pcre
    Save and exit

    Restart postifx:
    # service postfix restart
    that's all
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    For anyone who finds this and wants to follow, note that sender restrictions will usually have a lot more items that just the single one shown. Probably you can just insert this in the front of your existing list.
    MaxT likes this.
  5. MaxT

    MaxT Member HowtoForge Supporter

    you are right! ;)

Share This Page