Our web application emails us errors that occur in production, each of which has a unique subject and not all of which apply to me. For the errors that don't apply to my part of the app, I like to set a rule to move these to another folder based on what's in the subject. However, occasionally, one of the errors that usually doesn't apply to me does apply to me and the manager will forward the email to me so I can research the issue. The problem is that the forwarded email still contains the text of the original email's subject, so it gets picked up by my rule and moved to another folder.

What I want to do is set up a rule where the subject equals "Whatever Site Error". This way, when the boss forwards me the email where the subject is "FW: Whatever Site Error", the rule won't pick it up since the "FW: " piece makes it no longer match the condition in my rule.

I've looked into setting up a VBA macro that handles my rules, but that's just way too complex. So is there a way to do what I would like to do here?

Update: I have found a working solution that serves my purpose, but I would still like to know if there's a "subject equals" filter rather than "subject contains". My work-around solution is to put a rule constraint not only on the subject, but on the sender, as well. Since these errors are initially sent from "Site Support", I can set up my rule to look at the sender. This way, if my boss forwards me one of those emails, the sender constraint will return false and the email will default to my inbox.

6 Answers 6


Highlight an existing e-mail you want the rule to be based on (one with the subject you want the rule about), then click "Rules" on the "Home" tab. Click Create rule>Advanced, and you should see the option to check subject with your existing subject already added (the second one down in the screenshot).

enter image description here

P.S. You can also edit the text by checking the box, and then clicking the underlined text in the "Edit the rule description" box below. So just edit out the FW: part, it should still work for you since it is not an exact match situation, I believe, rather just must contain that string, so it should pick up both options. If it does not, create one rule for each subject.

  • 2
    But I don't want any of those other emails to even be evaluated by a rule. I want them to just go into my inbox like everything else. In other words, if the subject equals "Whatever Site Error", I want it to go to a specific folder. Otherwise, let it come through the inbox like normal. Jul 1, 2011 at 12:33
  • 1
    So you want the ones with FW to go to inbox, but the ones without FW to go to the special folder? But otherwise the subjects are equal?
    – KCotreau
    Jul 1, 2011 at 12:39
  • If the subject equals "Whatever Site Error", I want it moved to a folder named "Whatever". If it does not meet that criteria, no filter is applied at all and it goes to the inbox like normal. I do not want to set up any specific rule to handle emails with "FW" in the subejct. That would be if/else if logic and I only want if/else logic. Jul 1, 2011 at 12:58
  • I just added an update to my initial question. If you would like to keep looking into it then it would be greatly appreciated, but I somehow think such a constraint doesn't exist unless you check incoming emails with a VBA macro which I can do, but don't want to do =\. Thanks for putting the time into this so far. Jul 1, 2011 at 13:04
  • 1
    @oscilatingcretin I am also pretty sure there is not way around this, and I was going to also present a work-around type solution.
    – KCotreau
    Jul 1, 2011 at 13:34

Heres your answer, i hope will help:

Apply this rule after the message arrives with Whatever Site Error received in the subject
move It to the Whatever folder
except if the subject containsi
'RE: Whatever Site Error' or 'FW: Whatever Site Error'

this rule is good for automatic mails, but if someone Replay or Forward the mail this rule will not apply, so you wont mistake the automatic mails whit the users mail.

(!) Do not use exception like : except if the subject containsi 'RE' or 'FW' because it wont work in some cases if the subject contain wards whit RE , like (foREver, REceived,...)


The only answer I have come to is to use VBA to make this check. This is too tedious, though, so I abandoned the idea and went with the work-around mentioned in my question. If anyone knows how to do this through the standard rules interface then I give the answer to you.

Update 11/20/2012

While I haven't found the exact answer to my question, I did find a work-around that doesn what I need. What I do is set up a rule to stop processing more rules if the subject contains "RE:" or "FW:" and it to the top of the rule processing priority list so that it doesn't attempt to process any more rules against the message.


The following solution does what the OP wanted, except they said they didn't want to mess with VBA, because it was too complex. I agree, it is daunting. I consider myself a beginner in VBA for Outlook. But I had the same issue and the following macro worked for me, so I'm sharing it, in hopes that it will help someone.

Public Sub File_Stock_Incoming_Message(Item As Outlook.MailItem)
  ' This macro is called from a wizard-built rule, where the
  ' rule operates on *every* incoming message, and its action
  ' is to call this macro.
  Dim NS As Outlook.NameSpace
  Set NS = Application.Session
  Dim MoveToFolder As Outlook.MAPIFolder
  Set MoveToFolder = NS.Folders("mainboxname").Folders("MsgLog")

  Dim sbjstr As String
  sbjstr = Item.Subject
  If (sbjstr = "Whatever Site Error") Then
    Item.Move MoveToFolder
  End If
End Sub

Note that in this VBA code, the email will get filed into the MsgLog folder only if the subject exactly matches "Whatever Site Error". It will not file an email with the subject "Whatever Site Erro", nor will it file an email with a subject of "Whatever Site Errors". In fact, as written here, it is case-sensitive, so it won't even file an email with a subject of "whatever site error".

  • Caveat: A VBA-based answer only runs on the Outlook client, as far as I know.
  • Caveat: You have to enable macros in Outlook to use this solution.

If your manager forwards emails to you, edit your rule so that it filter only mails that come from the web application.

  • 2
    I just used my manager as an example. In reality, it could be any number of people forwarding me the emails and I shouldn't have to hard-write specific conditions into a rule when there should be a "subject equals" filter. It just makes sense to have that. Nov 18, 2011 at 14:40

No exact match. But one solution might be to do this:

  1. Setup the rule as you normally would with the looser "with [words] in the subject" (not an exact match)
  2. In the later "Except if" panel, add several common keywords for forwarding/replying.

This should at least work for my use case and is way simpler than trying to write up a VBS script for Outlook.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.