1195

How to prepend a tag to the beginning of a header

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 REPLY-TO HEADER contains
    2. If the MESSAGE has attachment(s)
  2. Click contains specific strings option in the Modify Rule window to bring up another window.
  3. Click the contains... option in the Specify Search Text to bring up another window.
  4. Select the drop down menu in the Options menu and choose Does Not Contain.
  5. Click OK
  6. Enter the local MDaemon domain and click add. (do not include any wildcards, just the domain).
  7. Enter any additional domain names that may be configured in MDaemon.
  8. Click OK
  9. Click the or link 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. Click OK