The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Filter syntax

Discussion in 'E-mail Discussions' started by Edward_, Dec 24, 2016.

  1. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    I'm trying to create a top level domain filter that will act on any TLD that Is Not: .com, .net, .org, etc.

    But the simple syntax I have tested deletes all emails. I have not been able to find detailed syntax requirements or examples for CP.
    filt_TLD.png

    Any advice greatly appreciated.
     
  2. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    What would result in an edit failure warning when one tries to edit a post?
    Even changing one period or letter causes this...

    - Removed -

    My content is Not spam-like nor does it contain inappropriate elements. Trying "later" did not help.

    Any advice appreciated.
     
    #2 Edward_, Dec 24, 2016
    Last edited by a moderator: Dec 24, 2016
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    New users are limited in what they can do, best to update thread with a new post.
     
  4. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    The top syntax also fails.
    It sends TLDs ending in .Com to Spam also.
    TLD_period.png
    Now testing com>.

    Suggestions?
     
  5. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    Edit:
    I could not have imagined this would be such an unknown by everyone.

    The com> test failed also.

    (still no edit privileged operating)

    Edit:
    For what period of time are messages held for moderation and Edit not available?
     
    #5 Edward_, Dec 27, 2016
    Last edited by a moderator: Dec 27, 2016
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You'll be able to edit posts after 5.
    What theme is that you're using for your cPanel?
    I'm unclear on what you're hoping to accomplish here.
     
  7. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    The control panel theme is: dark-theme

    What I'm trying to accomplish per my first post, is to declare any email not From a TLD of .com, .net, .org, .gov, me, care, etc. Spam, and handle it. Using the built-in 'From' and 'Does not end with' options. Maybe without using EXIM files directly.
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I set this one up and sent an email to the account from a domain using .info domain extension and the email was sent to spam.
    infotospam.png
     
  9. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    Thanks infopro

    Please test an incoming .com message to see if it goes to your Inbox also.

    When this filter fails for me, everything goes to the Spam directory.
    I just tested a From, Does not end with, .com, sent from a dot.com, from two different senders, both went to spam.

    I'm trying to use the Filter test in an an older CP version, but its Filter Trace Results are erratic and different each run, with many **** debug string too long - truncated ****, some filters are not shown.

    Once it indicated: 'Condition is true: $header_from: does not end .com
     
    #9 Edward_, Dec 27, 2016
    Last edited: Dec 27, 2016
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Edit the rule to use: Does Not Contain, and see if that gets you what you want. For me, it seems to.
    Emails from .com goes to inbox, .net, .info. .host, all go to spam.

    That test tool shows:

    Code:
    The Filter has matched the following condition(s):
    
        $header_from: does not contain .com
    
    
    Return-path copied from sender
    Sender      = someusr@server.example.com
    Recipient   = someusr@server.example.com
    Testing Exim filter file "/home/somecpusr/etc/example.com/someusr/filter"
    
    Deliver message to: "somecpusr+spam"@server.example.com
    Filtering set up at least one significant delivery or other action.
    No other deliveries will occur.
     
  11. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    Code:
    The Filter has matched the following condition(s):
    
        $header_from: does not contain .com 
    Ok, I have been testing a TLD filter using From, Does not contain, .com, (or) .net, (or) .edu. First .com individually, then with multiple criteria. The .com by itself does work -> Inbox. But when I have multiples (in same filter) like .com (or) .net (or) .edu (or) .gov (or) etc., the .com froms go to -> Spam. As quickly as I delete the other TLDs (leaving only .com) the filter works -> Inbox again.
     
    #11 Edward_, Dec 28, 2016
    Last edited: Dec 29, 2016
  12. Edward_

    Edward_ Member

    Joined:
    Dec 24, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    cPanel Access Level:
    Website Owner
    This seems to have been an OR/AND issue. When I changed the OR to AND for each, the .com messages pass to the Inbox, using multiple criteria (.com, .net, .org, .edu, etc...). Tests with incoming .net senders also passed to Inbox. Strange that the 'Does not end with' wouldn't work, mission accomplished.
     
  13. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thanks for posting an update to the thread.
     
Loading...

Share This Page