Creating an MDaemon Content Filter Rule to Run on Weekends Only

You can get very creative with MDaemon’s versatile content filter, performing a wide variety of tasks based on an equally wide variety of criteria. In this example, I’ll show you how to create a content filter rule that is triggered on messages sent on weekends only.

Two content filter rules are created – one to insert a date and time header into all messages, and one to act upon messages containing certain letters or words within that header.

First, let’s create our rule to insert a date and time header into all messages.

  1. In MDaemon, go to Security / Content Filter and click on New Rule.
  2. Enter a name for your new rule, such as “Add X-CF-Processed.”
  3. In the left-hand “Conditions” column, check the box “ALL MESSAGES.”
  4. In the right-hand “Actions” column, check the box “ADD an extra HEADER 1 to message.”Step4
  5. Click on the blue “specify information” link at the bottom of the window.
  6. In the “Header name” field, enter the name of the header you want to add. In this case, we’ll call it “X-CF-Processed.”
  7. In the Header Value field, enter $CURRENTTIME$. This is a macro that will insert the current day, date, and time into the message header.Step7
  8. Click “OK” to save your header information.
  9. Click “OK” to save your rule.

Now, we need to create a rule that looks for contents in the header that we created in the previous rule, and acts upon the message based on the contents of that header.

  1. Click on “New rule” and enter a name for your rule at the top, such as “Weekend Messages.”
  2. Under the left-hand “Conditions” column, check the box “If the user defined HEADER 1 contains.”
  3. Click on the blue text at the bottom “userdef1.”
  4. In the “User Defined Header” window, enter the name of the header we created in our first rule (X-CF-Processed), and then click on OK.



  1. Click on the blue text “contains specific strings.”
  2. Since we want this rule to run on weekends only, in the “Check for this string” field, enter “Sat” (without the quotes), and then click on Add. Then, enter “Sun” (without quotes) and click on Add again.Step6b
  3. Click on the word “and” (it will be a blue link), select the “Any or” option, then click on “Ok”.Step7b
  4. Click OK to close the “Specify Search Text” window.
  5. In the right-hand “Actions” column, select the action you wish to take, such as “DELETE the message” or “COPY the message to FOLDER.” You have many options here, including using macros to send a note back to the sender, copying the message to a custom folder, or moving the message to a custom queue. In this example, I’ve chosen to just delete the message. In addition to deleting the message, you could go one step further and send a note back to the sender of the message informing him or her that the message was deleted.Step9b
  6. Click “Ok” to save your content filter rule.

Using this technique, all messages sent on weekends will be handled based on how you have configured your content filter. You can get very creative with the content filter, so I recommend trying different filtering rules and macros in a test environment to become familiar with its versatility.



Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *