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.

Move all mails from all accounts to spam folder if some header is found

Discussion in 'E-mail Discussions' started by Augusto Will, Jul 20, 2017.

Tags:
  1. Augusto Will

    Augusto Will Active Member

    Joined:
    Sep 9, 2011
    Messages:
    39
    Likes Received:
    4
    Trophy Points:
    58
    cPanel Access Level:
    Root Administrator
    I need to move all e-mail with some header to spam forder of account. Example:

    user a@domain.com -> have some header -> move to spam folder of a@domain.com
    user b@domain.com -> have some header -> move to spam folder of b@domain.com

    Is possible to do that in anyway or use global filter of e-mails /etc/vfilter/domain.com and mode email from user account?

    Because one of domain has this code in /etc/vfilter this content:

    if
    $header_subject: contains "{vpara}"
    then
    deliver "\"domain+spam\""
    endif


    The problem of that is all mail that subject contains {vpara} is moved to spam folder of default account, not the account that received that e-mail.
    Is possible to use some variable to move the e-mail to the account that received that e-mail?
    Or do that with any other way?

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. Augusto Will

    Augusto Will Active Member

    Joined:
    Sep 9, 2011
    Messages:
    39
    Likes Received:
    4
    Trophy Points:
    58
    cPanel Access Level:
    Root Administrator
    I need to do globally, not per e-mail account.
    If possible with all e-mail in any e-mail account of the domain or better, any e-mail account in the server.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    There's no simple filter rule available for what you are seeking. Generally, this is setup by adding a custom SpamAssassin rule that detects messages as SPAM based on the content you specific. SpamAssassin documents how to write custom rules at:

    WritingRules - Spamassassin Wiki

    However, you may need to consult with a system administrator if you need help writing custom rules:

    System Administration Services | cPanel Forums

    Thank you.
     
Loading...

Share This Page