1. Knowledge Base
  2. MDaemon® Email Server

How to prepend a tag to the beginning of a header using the Content Filter

Using MDaemon's content filter, it's possible to prepend a tag or line of text to a header.

One example of why this would be useful it to tag messages from external servers that contain a attachment for security purposes. A tag can be added to inform the end-user the message contain an attachment(s) and is not from an local user. This example will be detailed below. However, the rule can be modified to meet different conditions and/or include multiple actions.

  1. Open MDaemon
  2. Select Security
  3. Select Content Filter
  4. Select New Rule

For the Conditions...

  1. Choose the following conditions in this order:
    1. If the user defined 1 header contains
    2. If the MESSAGE has attachment(s)
  2. Click userdef1: to bring up the user defined header window.
  3. Enter Return-path and click OK.
  4. Click contains specific strings option in the Modify Rule window to bring up another window.
  5. Click the contains... option in the Specify Search Text to bring up another window.
  6. Select the drop down menu in the Options menu and choose Does Not Contain.
  7. Click OK
  8. Enter the local MDaemon domain and click add. (do not include any wildcards, just the domain).
  9. Enter any additional domain names that may be configured in MDaemon.
  10. Click OK
  11. Click the OR link in between the two conditions and change the condition login to AND.

For the Actions...

  1. Choose Search and replace within HEADER
  2. Click specify information to bring up the Header - search and replace window.
  3. Select Subject in the drop down list.
  4. Enter in the Search expression text box.
  5. Enter the desired tag to add to the subject in the Replace with text box. 
    • For example [WARNING - REMOTE ATTACHMENTS]
  6. Leave a single space after your desired tag for the original subject line.
  7. Select Regular Expression
  8. Click OK