![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Is there a standard way to remove headers from inbound mail items?
Can I do something with Redemption like this?: sItem.Fields(PR_TRANSPORT_MESSAGE_HEADERS).Item(x) .Delete() Can I do this with PIA and C#? The problem I'm trying to solve is that the Outlook 2003 rules sometimes don't process. This could be because I have way too many rules (about 150 now) but I think it's more because our mail server is now adding a lot more header info to inbound mail. There is a long stream of Received headers, headers to tell us how the server anti-spam rated each mail item, and others. I think Outlook 2003 is confused by so many headers because my filtering no longer works on many items since we changed servers. So before rules are processed, I want to remove selected headers. I found some code by Ken Slovak for reading the headers: Dim oPropAccessor As Outlook.PropertyAccessor Const PR_MAIL_HEADER_TAG = _ "http://schemas.microsoft.com/mapi/proptag/0x007D001E" 'only works if Application.IsTrusted is True Set oPropAccessor = oItem.PropertyAccessor Another way to do this is with CDO: Const CdoPR_TRANSPORT_MESSAGE_HEADERS = &H7D001E strID = myItem.EntryID Set objMessage = objCDO.GetMessage(strID) Set objFields = objMessage.Fields txt = objFields.Item(CdoPR_TRANSPORT_MESSAGE_HEADERS).Va lue strHeaders = oPropAccessor.GetProperty(PR_MAIL_HEADER_TAG) The question is whether or not we can modify the resulting header string and then write back into these header fields. This is the first part of a two-part effort. I've never liked Outlook rules. I have about 150 of them (I know, too many) and they never really did process properly, so I'm going to write C# code (maybe open source) to replace the Outlook rules (unless someone can tell me Outlook 2007 is VASTLY better). My first step is to remove junk headers. The second step is to use the remaining headers and mail item to match on user-defined strings and regexp patterns, sort mail based on specs in Contact items and config files, etc. Thanks! Tony TG@ removethisNebula-RnD.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Removing downloaded headers from my Inbox | Brendan Burns | Outlook - General Queries | 1 | September 18th 06 03:20 PM |
Removing Rules per Script | Markus R. | Outlook - General Queries | 3 | August 30th 06 03:05 PM |
Removing Message Rules | Jack Gillis | Outlook Express | 4 | July 12th 06 10:05 PM |
removing headers | Bluesky | Outlook - General Queries | 1 | April 12th 06 09:33 PM |
OL 2002 SP3 : removing headers | Bluesky | Outlook - General Queries | 0 | April 11th 06 03:08 PM |