I would like to create a Search Folder in Outlook for a non-standard email header. Namely this one:
X-Bugzilla-Changed-Fields: Status Resolution
Is it possible to search on such headers? I'm using Outlook 2007.
I was trying to do the same recently and in searching the web encountered your question. I too failed to find any way to use the search folder to check headers. My assumption is because internet headers aren't really an "Exchange field", meaning that I don't believe any "intranet" email sent within the Exchange server itself (like that email you sent with the funny cat picture [LOLZ!] to your co-worker...) has such headers. But here is the workaround I came up with that I'm using.
I set up a new rule in the rules wizard that on receipt of new messages to check the headers. If a specific string is found then assign the message to a specific category. In my case I'm looking for messages that come from our Best Practical Request Tracker server, in each of those headers is the string "RT-ticket:". If my rules find this string in the header they then assign the message to a category I created named "RT Tickets". (I created this category with no color so it is less obtrusive.) I can then create a search folder that looks for messages of just that category. Extra steps but problem solved. I've done this in Outlook 2007 but it should work in any version of Outlook that supports the rules wizard checking headers and then assigning to categories.
The drawbacks to this are 1) yet another rule in my growing list, and 2) if I want to apply this to emails already received I'll need to go through and manually run the rule against those folders first. At this point I'm only concerned about new messages presently in my inbox or those arriving going forward so I simply set the rule to run at the time of creation and that was taken care of. A discovered benefit of using the categories though is that you can have it display as a column in your message list. I'm not sure I'll even be using the search folders as I had intended, I may just go and sort my inbox by category in order to find the desired messages.
If anyone needs the steps of creating a rule expanded I can do so, just leave a comment. I would hope though that if one is knowledgeable enough to be digging around in internet email headers that creating an Outlook rule would be old-hat. The wizard they have is pretty straightforward.
This PowerShell script searches all headers in Inbox for a match. It may take a while to run, depending on your inbox size. Some caveats apply, not the least of which is a possible residual outlook.exe process. This could be killed either manually in Task Manager, or programmatically via
If there is a nonzero set of matches, something like the following is returned.
You can then change the $MatchString assignment to the header string you're looking for. If you want to generalize the search using regular expressions, PowerShell makes that possible too.