Content filter moving mail to users' spam folder? | MDaemon Technologies, Ltd.

Content filter moving mail to users' spam folder?


  • Testing using the content filter to handle some of the spam we're receiving. I can't seem to find a way to filter the relevant mails, to users' spam folder, is there a workaround for this missing feature/rule?



  • You should be able to accomplish this in MDaemon by going to Security / Spam Filter / Settings, Check the box for "Move spam into user's IMAP spam folder automatically."  When it asks if you'd like to automatically create an IMAP filter rule for all accounts, select Yes.


  • Hi Arron,

    That works for spam marked e-mails, but I cannot see any way of getting the content filter to add a spam marking in the action list.


  • There is not a way to increase the score using a content filter rule, but there are other options. 

    1. You can write a content filter rule to rewrite the subject to label it as spam and move it to the spam folder.    It won't have the spam score in the subject though.  To move the message to the user's spam folder you'll need to use macros to create the path to the user's mailbox. Here is an example rule:

    [Rule004]
    RuleName=Mark as spam
    Enable=Yes
    ThisRuleCondition=Any
    ProcessQueue=BOTH
    Condition01=FROM|contains|AND|domain.bad|
    Action01=header search and replace|"Subject","(.*)","*** SPAM *** $0","0,1"
    Action02=copy to dir|"C:\MDaemon\Users\$RECIPIENTDOMAIN$\$RECIPIENTMAILBOX$\Spam.IMAP\"
    Action03=delete|

    Rewriting the subject can be very complex depending on how the subject is encoded, and my action may need to be tweaked.  Personally, if I didn't need to rewrite the subject, I'd just remove that part.  

    If you want to increase the spam score, you'll need to write your own customer spamassassin rules.   This is significantly more complex, but entirely doable.   There are several examples in the C:\MDaemon\SpamAssassin\rules\80_MDaemon_scores.cf that show how to check for the existence of headers and check the value of headers.

    If you are just wanting to add/remove from the spam score based on the sender domain, you can use the allow/block lists in MDaemon under Security / Spam Filter.  By default a match to the allow list subtracts 100 points and a match to the block list adds 100 points.

     

     

     

     


  • That rule suggestion workes just fine, thank you.

    I have also concluded that rewriting the subject is difficult. A Feature Request could be the ability to just add to the header, e.g.:

    Text="Possible SPAM"

    Position= [n] (0=Beginning, 65535=End, any other where it fits).

    Also it would be very helpful if it was possible to move the actions. If one makes a rule execution mistake now, you have to delete them and start over.


  • Thank you for your feedback, we'll add your ideas to our wishlist to be considered for future versions.


Please login to reply this topic!