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 user filter for children

Discussion in 'E-mail Discussions' started by Piston-Broke, Jan 5, 2017.

Tags:
  1. Piston-Broke

    Piston-Broke Registered

    Joined:
    Jan 5, 2017
    Messages:
    4
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Newcastle upon Tyne, UK
    cPanel Access Level:
    Website Owner
    Hi

    I am new to the forum but been using cpanel for a few years now

    I have just created an E mail address for my child and want to filter it so only selected emails (family and friends) get through to her tablet

    I have tried user level filtering to create the folowing filter

    From does not contain "dad@domain.com"
    or
    From does not contain "mam@domain.com"
    or
    From does not contain "grandma@domain.com"
    or
    From does not contain "aunty@domain.com"

    action

    redirect to dad@domain.com

    hoping this would send all but the listed emails to me and the listed email addresses to the newly created address, once it was working properly I would change action to discard message

    This filter sends all emails to my address including the ones listed above, I have tried does not contain and does not match but still just forwards messages to me

    Any help writing a filter to block all mails except those in the listed would be most helpful

    I used to have a filter like this working on my previous host but forgot to copy it when I swapped to my new host

    I am using cpanel version 58 build 37

    I have searched this forum and google and read the cpanel docs and all point to this should work unless I am missing something obvious
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,186
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @Piston-Broke,

    Try using "does not match" as the operator in the filter when entering the "from" addresses to see if that helps. Also, check your existing forwarders and filter rules to make sure email isn't already redirected based on an existing forwarder or filter rule.

    Thank you.
     
  3. Piston-Broke

    Piston-Broke Registered

    Joined:
    Jan 5, 2017
    Messages:
    4
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Newcastle upon Tyne, UK
    cPanel Access Level:
    Website Owner
    hi thanks for the advice. This is a new email addesss so no other forwarders and this is the only filter, I've tried does not contain and does not match and get the same result, Ive just tried tonight does not begin and does not end with still forwarding all mails including the ones listed in the filter
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,186
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Your access level is listed as "Website Owner". Do you have root access to this system, or is this a hosting account purchased from a provider? If you don't have root access, try contacting your web hosting provider so they can review the Exim logs to see why the filter isn't working as expected.

    Thanks!
     
  5. Piston-Broke

    Piston-Broke Registered

    Joined:
    Jan 5, 2017
    Messages:
    4
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Newcastle upon Tyne, UK
    cPanel Access Level:
    Website Owner
    It is a hosting account, Ill ask them to send the logs and see if I can see why

    Thanks
     
    cPanelMichael likes this.
  6. Piston-Broke

    Piston-Broke Registered

    Joined:
    Jan 5, 2017
    Messages:
    4
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Newcastle upon Tyne, UK
    cPanel Access Level:
    Website Owner
    hi
    thanks for all your help just to let you know my host managed to fix this by deleting filter I created to the following



    Code:
    if not first_delivery and error_message then finish endif
    
    #test - authorized addresses
    if
     $header_from: contains "dad@domain.co.uk"
     or $header_from: contains "mam@domain.com"
     or $header_from: contains "aunty@domain.com"
     or $header_from: contains "grandma@domain.com"
    then
     deliver "\"$local_part+INBOX\"@$domain"
    endif
    
    #test - unauthorized
    if
     $header_from: does not contain "dad@domain.co.uk"
     or $header_from: does not contain "mam@domain.com"
     or $header_from: does not contain "aunty@domain.com"
     or $header_from: does not contain "grandma@domain.com"
    then
     if error_message then save "/dev/null" 660 else fail "Email not authorised please contact dad@domain.co.uk to seek authorisation" endif
    endif
    
    
     
    cPanelMichael likes this.
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,186
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see the issue is now resolved. Thank you for updating us with the outcome.
     
Loading...

Share This Page