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.

filter vs filter.yaml

Discussion in 'E-mail Discussions' started by Dreww, Sep 3, 2012.

  1. Dreww

    Dreww Registered

    Joined:
    Sep 3, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello,

    We just recently added email accounts to our domain and the hoster provides cPanel Pro 1.0 (RC1) for configuring various email/filtering aspects. When I define an account level filter, ~/.cpanel/filter.yaml is created. When a user level filter is defined, ~/etc/domain/email_user/filter and filte.yaml are created.

    What is the difference between filter and filter.yaml and how are they applied by the email server?

    filter does identify itself as an Exim filter, while filter.yaml has no identifying information.

    Thank you.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Could you post the contents of filer and filter.yaml files for the example account?

    Also, why precisely are you asking about these? Are you planning on creating something manually using command line?

    Of note, you'd be better off using the API if you wanted to do something via a script for a mass filter creation.
     
  3. Dreww

    Dreww Registered

    Joined:
    Sep 3, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello Tristan,

    The primary reason for asking is to understand the relationship between the various filters and whether Exim uses them. With account level filtering, filter.yaml is created but no filter - is the system working properly or have I misconfigured something? And there is also ~/.filter which only seems to be created when Spamassassin is setup to delete all spam. Is that filter used by Exim?

    These are the user level filters:

    Code:
    // filter.yaml
    ---
    filter:
      -
        actions:
          -
            action: save
            dest: $home/mail/domain/user/.MYSPAM
        filtername: spam
        rules:
          -
            match: contains
            opt: or
            part: "$h_X-Spam-Status:"
            val: 'Yes'
        unescaped: 1
    
    // filter
    # Exim filter
    
    # Auto Generated by cPanel.  Do not manually edit this file as your changes will be overwritten.  
    If you must edit this filter, edit the corresponding .yaml file as well.
    
    if not first_delivery and error_message then finish endif
    
    #spam
    if
     $h_X-Spam-Status: contains "Yes"
    then
     save "$home/mail/domain/user/.MYSPAM/" 660
    endif
    There is one issue that I'm trying to resolve. When using cPanel user or account level filtering, the filter (above) always saves (GTUBE) spam and good emails to the .MYSPAM folder, no matter if Spam-Status is Yes or No. Good emails are never delivered to inbox.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The filter.yaml file is used by cPanel for the Account Level Filtering, but exim is pulling the data from /etc/vfilters/domain.com files instead. The filters are listed there that you place in Account Level Filtering.

    I don't know specifically for SpamAssassin and would have to check into it further.
     
  5. Dreww

    Dreww Registered

    Joined:
    Sep 3, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Ahhh yes, I have read about vfilters - our ~/etc folder has none. Perhaps I should contact our hoster to purge the /etc level domain filters?
     
Loading...

Share This Page