Control Web Panel

WebPanel => Postfix => Topic started by: detay on March 19, 2021, 10:44:20 AM

Title: Fighting Spam: Block entire TLD (Top Level Domain) with Postfix
Post by: detay on March 19, 2021, 10:44:20 AM
100% tested with CWP7Pro + Centos 7.9.2009

1. Write the tlds to be blocked to the sender_blacklist file. (/etc/postfix/sender_blacklist)
Example;
/\.asia$/ REJECT All Domain
/\.bg$/ REJECT All Domain
/\.bid$/ REJECT All Domain
/\.biz$/ REJECT All Domain
/\.br$/ REJECT All Domain
/\.buzz$/ REJECT All Domain
(...)

2. Get root access on your server;
# cd /etc/postfix
# postmap hash:/etc/postfix/sender_blacklist
# systemctl restart postfix.service

3. open the main.cf file (/etc/postfix/main.cf);

# rules restrictions
smtpd_client_restrictions = reject_unknown_client, check_client_access hash:/etc/postfix/sender_blacklist
smtpd_helo_restrictions =
smtpd_sender_restrictions = pcre:/etc/postfix/sender_blacklist
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031, permit_sasl_authenticated, permit_mynetworks, check_client_access hash:/etc/postfix/sender_whitelist, check_client_access hash:/etc/postfix/sender_blacklist, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net

save and exit.

4. And the end;
# systemctl restart postfix.service

Goodbye, spam mails ...  ;)
Title: Re: Fighting Spam: Block entire TLD (Top Level Domain) with Postfix
Post by: DNA on April 24, 2021, 07:52:24 AM
Hi
To monitor outgoing & incoming spamming , Mailwatch is best option for CWP .

(https://1.bp.blogspot.com/-0PaNvpKaxYo/YIPNZlJvEHI/AAAAAAAAGII/ypsP56A7GzAKGnoPCTFk1fMyxqsDZiycQCLcBGAsYHQ/s320/AntiSpam.png)

Let me know if you need any help
Title: Re: Fighting Spam: Block entire TLD (Top Level Domain) with Postfix
Post by: dp41646 on April 24, 2021, 09:56:02 AM
Wow, I didn't know that this exists.
Spam is a really big concern on my servers, and CWP unfortunately is not helping with that :/

It would be great to see this kind of integration officially with CWP!