How to Enable Auto Delete Spam for all accounts ?
How to Enable Auto Delete Spam for all accounts ?
Is there any way to do this in WHM or through SSH?
-
Well one way to do it would be to set up filters that discard emails they catch (such as spam) but that's not recommended. Another way would be to tell Spamassassin to discard spam emails it catches but that's not recommended either. You could create a spam@your-domain.com email and redirect everything there at least until you get the filters/settings configured a way you like them. That way you don't risk auto-deleting legit emails flagged as spam. I'm no pro but I've been fighting spam on my server for some time now using spamassassin and account level filters. We redirect everything to a spam vault and keep it around in case we need to search it for possible false positives. 0 -
Hello :) You may want to consider utilizing a global filter for Exim. The global filter file is located at: /etc/cpanel_exim_system_filter
You can copy this file to a new file and configure Exim to use the custom filter file via the following option under the "Filters" tab in "WHM Home " Service Configuration " Exim Configuration Manager": "System Filter File" Thank you.0 -
Hello after a long time I found out how to auto delete for all accounts, I will share here because maybe some users may have last the same as I passed, below steps: First you need to create 3 files with content in them, I recommend also create a folder to store the files, in my case I created the folder /spmass and access folder mkdir /spmass ; cd /spmass
First create three files with the names and permissions: Use the nano editor to create the files: .filter filter.cache filter.yaml Permissions 0644 Below is a step by step: Then edit each and place the contents as follows: File .filter :nano .filter
Paste content:$h_X-Spam-Bar: contains "+++++"+++++++/dev/null
File filter.cache :nano filter.cache
Paste content:pst0 -Generated Apache SpamAssassin" Discard Rule filtername /dev/nulldest saveactionactions $h_X-Spam-Bar:part containsmatch +++++val
File filter.yaml :nano filter.yaml
paste content:--- filter: - actions: - action: save dest: /dev/null filtername: Generated Apache SpamAssassin" Discard Rule rules: - match: contains opt: or part: "$h_X-Spam-Bar:" val: +++++
Change permissions:chmod -v 0644 filter* ; chmod -v 0644 .filter
Done all the above procedures is only run the following command:for user in `ls /var/cpanel/users/` ; do rsync -v /spmass/.filter /home/$user/ ; chown -v $user:$user /home/$user/.filter ; rsync -v /spmass/filter.* /home/$user/.cpanel/ ; chown -v $user:$user /home/$user/.cpanel/filter* ; done
Restart Exim:service exim restart
Ready! Now Spam Auto-Delete feature automatically deletes messages enabled! for all domains and existing accounts in cpanel, if you need to do this for future domains created on the server, simply place the command in a cron job. I hope this helps.0 -
I am happy to see you were able to find a solution. Thank you for updating us with the outcome. 0 -
This setting works with the Force Global On option spamassassin, it automatically deletes those spam, greatly decreases the spam rate in inboxes, but I only use this option because I turn off the Box Trapper. 0
Please sign in to leave a comment.
Comments
5 comments