How to remove keywords from the subject or body of replies on on-premises Exchange?

Although prepending special words to emails is definitely easy to achieve natively, it is not possible, using Exchange mail flow rules or Outlook rules, to remove those words automatically from email subject or body when replying or forwarding. If you prepend any keywords to incoming emails like e.g. the word EXTERNAL, to let people know the email originates from the outside of an organization, it will stick to it also in replies and forwards. And this is not what generally the user wants to happen. So if you need to remove any prepended keywords or phrases from email subject or body before the message hits the original sender, you need to either write your own piece of code or use a third party tool like CodeTwo Exchange Rules Pro.

And if code writing is not what makes you enthusiastic, then using CodeTwo Exchange Rules Pro is your option.

How to remove keywords from subject line or email body in replies

Note: CodeTwo Exchange Rules Pro is a server-side program that integrates with Exchange 2016, 2013, 2010, and 2007 or mixed environments that consist of any combination of the above-mentioned Exchange versions. In the first place, you can use it to centrally create and manage advanced HTML email signatures for all users, but also you can use it to control email flow in your organization – including removing keywords or entire phrases from the email subject line and the body. A full list of program features can be found here.

Remove keywords from email subject when replying externally

So let’s assume that you have created a rule, which adds a word [EXTERNAL] to the subject line of all incoming emails. The reason for that may be to warn employees that the email comes from an external user and they should be 100% sure before they open any attachments coming in with this email. If the sender is to be trusted and a user wants to reply to such a message then the word [EXTERNAL] should be removed from the email subject line before it reaches the recipient. And this is where CodeTwo solution comes in.

To remove certain keywords from email subject on the server side automatically, follow the steps below:

  1. Open the Administration Panel of CodeTwo Exchange Rules Pro and create a new rule using the Add button.
    Add a new rule in CodeTwo Exchange Rules ProImportant: If you don’t have CodeTwo Exchange Rules Pro running in your organization, you can try this setup out on a trial version. The trial version has all the functionalities of a licensed version and is valid for 30 days. Here you can download the program for testing purposes. It’s free.
  2. Name your rule and go to the Conditions tab.
  3. In the Conditions tab, set up the following condition Subject > contains keywords > [external]. When editing the keyword, make sure to select a checkbox next to Remove this keyword/phrase from email if found. Then, when the program finds the [external] keyword in the subject, it will remove it automatically.
    Set up a keyword to be removed from the email subject or body.
  4. (Optional) If you want to remove keywords also from the email body, add another condition as shown in the screenshot below. Use And and Or operators to specify if the program needs to meet both conditions or just one of them.
    Add the action to scan both subject and body of emails.
  5. The Exceptions tab can stay as it is unless you want to exclude some emails or users from this rule.
  6. In the Actions tab, click the Add button and select the Remove keywords action.Add an action Add the Remove keywords action
  7. Then, add the keyword you specified in the Conditions tab – in this case, it is [external].
    Set up a keyword in the action
  8. Once the rule is ready to go on production, submit changes.
    Submit changes
  9. Now you can test the settings by replying to a message containing the [EXTERNAL] keyword in the subject.

That’s it. This is a very simple way to get rid of unwanted words and phrases from both email subject and body in replies and forwards.

Note that you can also use CodeTwo Exchange Rules Pro to do the first part of the task, which is to stamp external emails with the word [EXTERNAL]. This way, you would have both rules controlled via the program’s Administration Panel saving you time and effort.

Suggested reading:

2 thoughts on “How to remove keywords from the subject or body of replies on on-premises Exchange?


  1. Unfortunately it is not possible to remove a line that includes a piece of HTML (‘click >a href=”#foo”>here to mark this message as spam’, ‘sent with Outlook for IOS‘). This means that replying to an external message will expose our internal ‘mark as spam’ link to the customer.

    • Hi Sander,
      You are right – unfortunatelly in the current version, it is not possible to entirely delete links and other HTML pieces. However, if you choose to delete the whole hyperlink text (for example, “Outlook for iOS”), the link will not appear in the email content. To see it, the recipient would have to inspect the source HTML of an email, which is rather unlikely for email users.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

*