Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Incoming malformed junk mail

Discussion in 'E-mail Discussion' started by Carlos Morales, Dec 14, 2018.

Tags:
  1. Carlos Morales

    Carlos Morales Registered

    Joined:
    Dec 14, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    san jose, costa rica
    cPanel Access Level:
    Root Administrator
    Hi, I'm getting junk mail from addresses like this "info@example.cominfo@demo.com"
    It's not a valid email and I need to reject it as I create a rule for filtering.?
     
  2. Shood

    Shood Well-Known Member

    Joined:
    Aug 12, 2015
    Messages:
    74
    Likes Received:
    14
    Trophy Points:
    83
    Location:
    Middle East
    cPanel Access Level:
    Root Administrator
    Hi @carlos
    You can create a new file into /usr/local/cpanel/etc/exim/sysfilter/options directory with the below code, full details here
    Code:
    Code:
    if $h_from: contains "info@example.cominfo"
    then fail
    endif
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Carlos Morales,

    The information in the previous post should help if you want to filter emails from that address system wide. To filter emails from that address on an individual account, you can use the Global Email Filters option in cPanel. Let us know if you have any additional questions.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,257
    Likes Received:
    86
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    I see similar quite often, and what you'll find is that they will all be different and constantly changing, so creating a rule based on the sending source might not work.

    Threfor, I looked up 'regex double @' and came up with this.

    Postfix Blocking E-mail from address containing two @ symbols

    Maybe a rule along the lines might work:

    if $h_from: contains "/@.*@/"
    then fail
    endif

    trial and error I guess ???.
     
    Carlos Morales likes this.
  5. Carlos Morales

    Carlos Morales Registered

    Joined:
    Dec 14, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    san jose, costa rica
    cPanel Access Level:
    Root Administrator
  6. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    1,088
    Likes Received:
    442
    Trophy Points:
    113
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    Be careful with the "/@.*@/" rule (and there is a variation circulating that uses ".+@.+@.+" that has issues as well)

    If a genuine user configured their SMTP address in their mail client in the format eg admin@domain.com <admin@domain.com> or "admin@domain.com" <admin@domain.com> the rule may match and you would lose the mail.

    Use your cPanel filter to configure and thoroughly test the regex before deploying it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Carlos Morales likes this.
  7. Carlos Morales

    Carlos Morales Registered

    Joined:
    Dec 14, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    san jose, costa rica
    cPanel Access Level:
    Root Administrator

    It does generate problems when trying to send emails.
    Can you put negative filters?
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice