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.

Filtering Email to Folders

Discussion in 'E-mail Discussions' started by java_dude, Oct 1, 2007.

  1. java_dude

    java_dude Active Member

    Joined:
    Apr 23, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello, recently I've started using Roundcube for my webmail client and have an issue with filtering/sorting my email into folders. I have MailScanner installed and it successfully marks spam messages as spam, but what I'd like to do is set up a filter so that for all of the email accounts I have set up, the potential spam messages get moved to a "Junk" folder. I was reading the Exim website and it looks like it has Sieve support built in. So I placed a .forward file in my home directory ("/home/username/.forward") with the following ruleset:

    Code:
    require ["fileinto"];
    
    if anyof (
            header :contains ["X-MYORG-MailScanner-SpamScore"] "sssss",
            header :contains ["X-MYORG-Spam-Flag"] "Yes"
    ) {
            fileinto "Junk"; stop;
    }
    But it doesn't seem to work... it's like Exim isn't picking up on the file at all. Is there anything special I need to do to get this working in a cPanel server? Because I noticed that at the top of my exim.conf file it says that it's a cPanel Exim config file, so I'm wondering if that has anything to do with it not working.

    Thanks in advance for any help you guys can give!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you are setting up a mail filter for all accounts on a domain, you may want to use account level filtering. Simply login to your cPanel interface and in the Mail feature block go to Account Level Filtering and use that interface.

    Additionally, when I set up mail filters, I typically use cPanel's interfaces for it rather than the interfaces provided by individual mail clients such as Roundcube. This is so if I want to check mail via another client or via another IMAP client, all my mail is already sorted.
     
  3. java_dude

    java_dude Active Member

    Joined:
    Apr 23, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Thanks for the reply David. I actually tried the account level filtering option, but I couldn't get it working properly (maybe I wasn't using it correctly?). The problem is that I'm using MailScanner to scan for viruses/spam, so the headers are different from the ones provided in the cPanel dropdown list and they aren't going to work.

    So I thought that a .forward file would be perfect for this, as I can add all the rules I need very quickly. Is it possible to use a .forward file for filtering rules like it explains in the Exim documentation?

    Thanks again! :)
     
  4. java_dude

    java_dude Active Member

    Joined:
    Apr 23, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Does anyone have any ideas as to why my .forward file isn't being picked up by exim? Or is it possible to create a filter in cPanel that would act like the filter I posted in my first post?
     
Loading...

Share This Page