Testing of Email Filters Not Working

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
When we add any filter using User Level Filtering or Account Level Filtering, they do not seem to take effect.

When we do a Filter Test, a blank result shows up.

How do we resolve this problem?
 

serlex

Well-Known Member
Oct 20, 2009
57
0
56
Hi,

Rather than doing a test via cPanel, have you tried testing by sending any emails that meet the filtering rules?

Try to use 'contains' and not equals, don't know equals doesn't work for me
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
When we add any filter using User Level Filtering or Account Level Filtering, they do not seem to take effect.

When we do a Filter Test, a blank result shows up.

How do we resolve this problem?
What is the full cPanel version and build number of the system?

The above can be obtained by running the following command via root SSH access and simply copying-and-pasting the displayed output:
Code:
# grep -H '' /etc/*release /usr/local/cpanel/version /var/cpanel/envtype
 

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
The output is as follows:
Code:
/etc/redhat-release:CentOS release 5.4 (Final)
/usr/local/cpanel/version:11.25.0-STABLE_44718
/var/cpanel/envtype:xen pv
 
Last edited by a moderator:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
The output is as follows:
Code:
/etc/redhat-release:CentOS release 5.4 (Final)
/usr/local/cpanel/version:11.25.0-STABLE_44718
/var/cpanel/envtype:xen pv
Thank you for the version details. The issue of not displaying output from e-mail filter test results was recently investigated and escalated through to resolution; the aforementioned issue should be fully alleviated in an upcoming new build of cPanel version 11.25.0.

Having automatic updates enabled will ensure the affected system receives any new updates and or applicable bug-fixes promptly upon availability; the update configuration can be viewed and modified via WebHost Manager (WHM) at the following menu path:
 

keywaystab

Member
May 26, 2005
6
0
151
When we add any filter using User Level Filtering or Account Level Filtering, they do not seem to take effect.
Valetia,
Is this statement meant to read that only the *testing* of filters with cPanel is not working, or are you actually experiencing trouble with the real filters?

After updating to 11.25.0-STABLE_44718 on one "FreeBSD 6.2-STABLE" system and to 11.25.0-CURRENT_44718 on another "FreeBSD 6.2-STABLE" system, both appear to be failing to process the email filters (account level, or user level).

cPanelDon,
Is there further documentation on these filters that you can direct us towards?
 

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
Valetia,
Is this statement meant to read that only the *testing* of filters with cPanel is not working, or are you actually experiencing trouble with the real filters?
Both, actually. The *testing* of filters doesn't work 100% of the time, while the real filters may or may not work depending on how they're set up.

For example, if you try to filter an email whose subject 'ends with' a certain string, it may not work. But changing it from 'ends with' to 'contains' may work...
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Last edited:

keywaystab

Member
May 26, 2005
6
0
151
The Exim documentation details the applicable specification of mail filtering via Exim filters; please see the following resources for verbose information:
cPanelDon,
I appreciate the links to the Exim docs, and I will review them further; however, I actually meant to ask whether there was cPanel documentation regarding the cPanel implementation of these filters?

My understanding is that a "yaml" file is created from the cPanel interface, which is then somehow parsed into the filter/.filter file where appropriate. I'd like to read the documentation on how this is all performed so that I can better troubleshoot.

While I'm asking for documentation, is there a unified set of documentation regarding the scripts in /scripts? We regularly run into issues, and have to guess as to which script will be fitting for our need, and search the forums in hopes that there is mention of that particular script name. If there is documentation in place for what each of the scripts does, this would be incredibly beneficial to us.

Thank you very much.
 

Zepplin

Well-Known Member
Oct 23, 2006
93
1
158
Blue Mountains, Australia
cPanel Access Level
Root Administrator
Thank you for the version details. The issue of not displaying output from e-mail filter test results was recently investigated and escalated through to resolution; the aforementioned issue should be fully alleviated in an upcoming new build of cPanel version 11.25.0.

Having automatic updates enabled will ensure the affected system receives any new updates and or applicable bug-fixes promptly upon availability; the update configuration can be viewed and modified via WebHost Manager (WHM) at the following menu path:
Filter Trace is now showing all results from any filter tests as expected with the latest upgrade cPanel 11.25.0-C45139

Cheers
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
308
cPanel Access Level
Root Administrator
cPanelDon,
I appreciate the links to the Exim docs, and I will review them further; however, I actually meant to ask whether there was cPanel documentation regarding the cPanel implementation of these filters?

My understanding is that a "yaml" file is created from the cPanel interface, which is then somehow parsed into the filter/.filter file where appropriate. I'd like to read the documentation on how this is all performed so that I can better troubleshoot.
The YAML file is simply a data store of the filters for an account. The file itself is not documented as it's intended for internal use only.

While I'm asking for documentation, is there a unified set of documentation regarding the scripts in /scripts? We regularly run into issues, and have to guess as to which script will be fitting for our need, and search the forums in hopes that there is mention of that particular script name. If there is documentation in place for what each of the scripts does, this would be incredibly beneficial to us.

Thank you very much.
Many, if not most, scripts in the /scripts directory are old and not recommended for use. Those that are recommended and maintained are documented here WHM Scripts.

If you have questions about a specific script feel free to ask about it. If you have a solid grasp of Perl you can also examine the script itself.
 

rlerner

Member
Aug 13, 2006
6
0
151
Same problem here. Believe the filters are working, but not the "Test Filter" feature when creating new filters in cPanel.

Screen reads "Filter Trace Results:" and then has an empty one-line box. Screenshot below:


Using cPanel 11.25.0 r44718, auto updates nightly. Here is my configuration:

/etc/redhat-release:CentOS release 5.4 (Final)
/usr/local/cpanel/version:11.25.0-RELEASE_44718
/var/cpanel/envtype:standard

Anyone have any ideas how to fix this?:confused:
 
Last edited by a moderator:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Same problem here. Believe the filters are working, but not the "Test Filter" feature when creating new filters in cPanel.

Screen reads "Filter Trace Results:" and then has an empty one-line box. Screenshot below:


Using cPanel 11.25.0 r44718, auto updates nightly. Here is my configuration:

/etc/redhat-release:CentOS release 5.4 (Final)
/usr/local/cpanel/version:11.25.0-RELEASE_44718
/var/cpanel/envtype:standard

Anyone have any ideas how to fix this?:confused:
Build number 44718 was released before the issue was corrected and so it does not contain the subsequent fix you are expecting. At the present time I believe all build trees except STABLE and RELEASE contain the specific correction; you may either opt to wait until STABLE and or RELEASE have a new build generated or switch to the CURRENT build tree to receive the update sooner.

The following resource may be used to verify when a new build is available: cPanel Downloads - Latest cPanel/WHM Builds
 
Last edited:

urano007

Member
Feb 11, 2007
5
0
151
Seems like the problem persists...

Build number 44718 was released before the issue was corrected and so it does not contain the subsequent fix you are expecting. At the present time I believe all build trees except STABLE and RELEASE contain the specific correction; you may either opt to wait until STABLE and or RELEASE have a new build generated or switch to the CURRENT build tree to receive the update sooner.

The following resource may be used to verify when a new build is available: cPanel Downloads - Latest cPanel/WHM Builds
I have 11.25.0-R46156 and the filters are not working.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I have 11.25.0-R46156 and the filters are not working.
Please submit a support request so that we may assist with investigating the issue affecting your server; direct access is required so that we can properly diagnose and verify the specific circumstances involved. When available, please let me know the ticket ID number of your support request so that we may follow-up internally.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
745130

Thanks!
During investigation two important areas of interest were noted:
  • Issue #1.)
    When testing filters on the system, with cPanel version 11.25.0-RELEASE_46156, we verified that using the X3 theme allows filter test output to display normally whereas using the configured third-party theme, from RVSkin version 9.75, filter test output was not displayed. To clarify, filter test output was not shown due to the affected cPanel account using a third-party theme that was found to contain a minor typo in the following file:
    Code:
    /usr/local/cpanel/base/frontend/rvskin/mail/filters/filtertest.html
    The same issue was already corrected in the stock-default X3 theme (as detailed earlier in this thread), but if a third-party theme is affected that would require an update from the applicable third-party vendor or developer. The fix used may be based off of the corrected file in X3. For information on applying a fix manually, here is output from "diff" showing the applicable line, before and after correction:
    Code:
    -		<div class="output" name="tracefilter" cols="80" rows="15" readonly style="text-align:left;"><pre><?cp Email::tracefilter(%,trace) account=$FORM{'account'},msg=$FORM{'msg'})"></pre></div>
    +		<div class="output" name="tracefilter" cols="80" rows="15" readonly style="text-align:left;"><pre><?cp Email::tracefilter(%,trace) account=$FORM{'account'},msg=$FORM{'msg'} ?></pre></div>
  • Issue #2.)
    When using "equals" this will require the e-mail header to exactly match the filter rule criteria; for example, the following filter rule and example e-mail header do not exactly match when processed by Exim:
    Code:
    [B]Filter Rule:[/B]
    From [U]equals[/U]
    [I][email protected][/I]
    
    [B]E-mail Header:[/B]
    From: [I]"Domain User" <[email protected]>[/I]
    
    [B]Outcome/Result:[/B]
    Header '[I]"Domain User" <[email protected]>[/I]' [U]does not equal[/U] filter-defined criteria '[I][email protected][/I]'
    This will not trigger the action defined in your e-mail filter.
    The From mail header is set by the sender's mail client and for this reason we recommend considering use of "contains" or "matches regex" instead of "equals" to better account for unforeseen differences in the From header of incoming messages. Here are a few examples to consider, one that still uses "equals" and another that uses "contains":
    Code:
    [B]Filter Rule:[/B]
    From [U]equals[/U]
    [I]"Domain User" <[email protected]>[/I]
    
    [B]E-mail Header:[/B]
    From: [I]"Domain User" <[email protected]>[/I]
    
    [B]Outcome/Result:[/B]
    Header '[I]"Domain User" <[email protected]>[/I]' [U]equals[/U] filter-defined criteria '[I]"Domain User" <[email protected]>[/I]'
    This will trigger the action defined in your e-mail filter.
    Code:
    [B]Filter Rule:[/B]
    From [U]contains[/U]
    [I][email protected][/I]
    
    [B]E-mail Header:[/B]
    From: [I]"Domain User" <[email protected]>[/I]
    
    [B]Outcome/Result:[/B]
    Header '[I]"Domain User" <[email protected]>[/I]' [U]contains[/U] filter-defined criteria '[I][email protected][/I]'
    This will trigger the action defined in your e-mail filter.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Build number 44718 was released before the issue was corrected and so it does not contain the subsequent fix you are expecting. At the present time I believe all build trees except STABLE and RELEASE contain the specific correction; you may either opt to wait until STABLE and or RELEASE have a new build generated or switch to the CURRENT build tree to receive the update sooner.

The following resource may be used to verify when a new build is available: cPanel Downloads - Latest cPanel/WHM Builds
I have 11.25.0-R46156 and the filters are not working.
For reference and clarification, the issue that affected the display of filter test results is corrected in all build trees, including STABLE, RELEASE, CURRENT, and EDGE; all builds numbered 45750 or higher are inclusive of the applicable correction in the cPanel X3 theme.