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.

Account-level Filtering Rules for Forwarded Emails

Discussion in 'General Discussion' started by hominid4, Apr 28, 2016.

  1. hominid4

    hominid4 Registered

    Joined:
    Apr 28, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    San Diego, CA
    cPanel Access Level:
    Root Administrator
    I’m on a shared hosting server, and have a Account-level Filtering set in the cPanel to redirect all emails that contain zip attachments to a specified email address. What I have works just fine with emails received, but if the email is a forwarded email with the zip attachment then it’s not filtered. Is there different rules for emails that are forwarded?

    If for example someone receives an email with a zip attachment, and then forwards that email to me it's delivered into my regular email account, it's not filtered and redirected to the specified email account in the rules. This what I currently have under the Account-level Filtering:
    Code:
    Any Header : matches regex
    (?:file)?name=(\\\\"[^\\\\"]+\\\\.(?:zip)\\\\")
    
    Any Header : matches regex
    (?:file)?name=(\\\\S+\\\\.(?:zip))
    
    Body : matches regex
    (?:Content-(?:Type:(?>\\\\s*)[\\\\w-]+/[\\\\w-]+|Disposition:(?>\\\\s*)attachment);(?>\\\\s*)(?:file)?name=|begin(?>\\\\s+)[0-7]{3,4}(?>\\\\s+))(\\\"[^\\\"]+\\\\.(?:zip)\\\")[\\\\s;]
    
    Body : matches regex
    (?:Content-(?:Type:(?>\\\\s*)[\\\\w-]+/[\\\\w-]+|Disposition:(?>\\\\s*)attachment);(?>\\\\s*)(?:file)?name=|begin(?>\\\\s+)[0-7]{3,4}(?>\\\\s+))(\\\\S+\\\\.(?:zip))[\\\\s;]
    
    Body : contains
    .zip
    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Does this apply to any email that's forwarded to your account, both from the same cPanel server and from remote addresses such as Google/Yahoo/Hotmail?

    Thank you.
     
  3. hominid4

    hominid4 Registered

    Joined:
    Apr 28, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    San Diego, CA
    cPanel Access Level:
    Root Administrator
    Hello! Yes, any email. I've tested it with forwarding an email with a zip attachment I had received to my domain email that's within the cPanel with the filter, forwarding an email from Gmail and Yahoo, and forwarding an email from one of my remote domains that I have on a different hosting server. None of them are filtered. And I first noticed this when a couple of our clients forwarded emails with zip attachments and those weren't filtered, but if they send a new email with a zip attachment they do get filtered.

    Thanks for the help!
     
  4. hominid4

    hominid4 Registered

    Joined:
    Apr 28, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    San Diego, CA
    cPanel Access Level:
    Root Administrator
    Sorry, I've been doing a lot more testing, and it does seem to be working today from Gmail and from a domain's webmail. But when a forwarding an email using an email client it's not filtering. I'll do more testing and research on that, and will report back.

    Thanks.
     
Loading...

Share This Page