Copying the Account level filter over to Global filter
Hello Everyone,
I have a very big filter rule I have created under cPanel home >> Email filters option specifically for an email account say test@domain.com.
I wish to copy that one filter rule over to cPanel home >> Global Email Filters option.
I have tried the following:
~~~~~~~
Copied the filter rule from: /home/username/etc/domain_name/email_username/filters
----
#Filtername
if
$header_from: is
.............
..............
..............
..............
..............
..............
then
save "/dev/null" 660
endif
Over to the file /etc/vfilters/domain_name
~~~~~~~
It does not seem to be working. Please suggest me a solution for the same.
-
Hello, The syntax of the filters for global and user is the same, the following is an example from my test server: [root@server ~]# cat /home/user/etc/example.com/mailuser/filter # Exim filter - auto-generated by cPanel. # # Do not manually edit this file; instead, use cPanel APIs to manipulate # email filters. MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN. # headers charset "UTF-8" if not first_delivery and error_message then finish endif #example2.com if $header_from contains "example2.com" then save "/dev/null" 660 endif
[root@server ~]# cat /etc/vfilters/example.com # Exim filter - auto-generated by cPanel. # # Do not manually edit this file; instead, use cPanel APIs to manipulate # email filters. MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN. # if not first_delivery and error_message then finish endif #example2.com if $header_from: contains "example2.com" then save "/dev/null" 660 endif
What should be noted is that these files shouldn't be modified directly you should be using the API calls to make modifications to them if you need to make the modifications via CLI. You can find the Email filter functions in our documentation for example this one will list all email filters for an account:0 -
Hi @Srinath S M I understand that could become overwhelming with that many addresses. What might be a solution for you as it can be done via CLI is utilizing the exim custom filter. This would implement server wide filtering. We have documentation on how this is done here: UAPI Functions - Email::enable_filter - Developer Documentation - cPanel Documentation 0
Please sign in to leave a comment.
Comments
3 comments