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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Comparing Subject and Sender

Discussion in 'E-mail Discussions' started by cyber_cynic, Aug 15, 2017.

Tags:
  1. cyber_cynic

    cyber_cynic Registered

    Joined:
    Aug 15, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Home
    cPanel Access Level:
    Website Owner
    I noticed a lot of my spam has the following header formats:
    Subject: Some Spam Sender
    From: SomeSpamSender@spammer.com

    Is there way to compare headers without piping to a separate script?

    Essentially I would like to set the following filter:

    If "From" contains ["Subject" without white spaces]
    Then Discard message.

    Any help would be appreciated.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This isn't possible with a standard filter rule, but you might be able to get that working using a custom regular expression in the filter. You may want to seek out advice from the Exim users mailing list if you do not receive additional user-feedback on this thread:

    Exim-users Info Page

    Thank you.
     
  3. cyber_cynic

    cyber_cynic Registered

    Joined:
    Aug 15, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Home
    cPanel Access Level:
    Website Owner
    I apologise if I was not clear in my post.
    I am looking for a "regex" for the rhs of the filter.
    So the first question would be: Is "Subject" a reserved word that can be used in an expression?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It doesn't appear as though you can use variables for the operators in that way (e.g. $message_body contains "\\$header_subject"). Exim provides in-depth documentation on filter rules at:

    3. Exim filter files

    You may want to setup a custom filter rule for testing and consult with the Exim user's mailing list to see if anyone has setup something similiar.

    Thank you.
     
Loading...

Share This Page