Author Topic: Email filters in CWP Web Panel?  (Read 1776 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Email filters in CWP Web Panel?
« on: December 11, 2022, 06:44:21 PM »
Does anyone know how to block an entire tld using wildcards with this new email filter? The docs seem short on details to me; https://docs.control-webpanel.com/docs/user-guide/email-accounts/email-filter

How exactly would one block any emails from ".guru " -- typically I would use "*@*.guru" but, is that allowed? Would I use "contains" or "is equal to?"

I've search online but, it seems as though this feature is so new, there are no real world practical examples of the filters being used. The example youtube video is all fluff.

Offline
***
Re: Email filters in CWP Web Panel?
« Reply #1 on: December 12, 2022, 09:21:10 AM »
afaik u need do some changes at the config.....




and for me... i dont know because when i use cwp/cpanel/cyberpanel i tell to my self to do not touch anything manually if not urgent

Offline
***
Re: Email filters in CWP Web Panel?
« Reply #2 on: December 20, 2022, 12:10:36 AM »
If you have access to the root server with ssh then do this:

Disclaimer: This will have result on the entire server, not just for one domain like you asked for.

Edit postfix main.cf and add this under smtpd_sender_restrictions
Code: [Select]
check_sender_access hash:/etc/postfix/sender_accessCreate file '/etc/postfix/sender_access'
Add this to the file:
Code: [Select]
/\.TLD$/ REJECTor
Code: [Select]
/\.TLD$/ 550 BlacklistedThe second one will send a "550 Blacklisted" error message to the sender

Then run command:
Code: [Select]
postmap /etc/postfix/sender_access
then restart postfix

This will block the TLD from ever getting the message sent to your server.


OR

if you want for one domain/email account, I advice opening up the mail account with roundcube and edit the filter from there. The filter manager on CWP has been buggy in the past (user/file permissions issues), though I'm not sure if it's been fixed.

Here's an example:


and change actions to "delete message".
This will not block it, but it will delete it. Filters don't block. Filters works because it first has to receive the message to know what to do with it.
« Last Edit: December 20, 2022, 12:15:57 AM by iraqiboy90 »

Offline
*
Re: Email filters in CWP Web Panel?
« Reply #3 on: December 27, 2022, 07:56:23 PM »
Thanks for your reply and example.

The problem is, I can't get the roundcube filters to work using wildcards.

You can delete all emails containing ".win" but, that would also delete an email from carl.winslow@gmail.com

What I need to do is block all emails from the .win TLD using *@*.win

I can't find any example of that or documentation about it with roundcube.

Offline
****
Re: Email filters in CWP Web Panel?
« Reply #4 on: January 31, 2023, 04:19:32 AM »
You can also block via SpamAssassin (I'm pretty aggressive here -- even risking blocking Alphabet's .xyz domain):
Code: [Select]
# blacklist TLDs
blacklist_from *@*.casa
blacklist_from *@*.work
blacklist_from *@*.top
blacklist_from *@*.live
blacklist_from *@*.cam
blacklist_from *@*.pro
blacklist_from *@*.click
blacklist_from *@*.link
blacklist_from *@*.diet
blacklist_from *@*.party
blacklist_from *@*.zip
blacklist_from *@*.date
blacklist_from *@*.club
blacklist_from *@*.rest
blacklist_from *@*.bar
blacklist_from *@*.xyz
blacklist_from *@*.sbs
blacklist_from *@*.shop