none
Reset / Override Outlook specific headers RRS feed

  • Question

  • Hi,

    When using Outlook and displaying the content of a Gmail mailbox, some of the date displayed in the Outlook overview are not correct. I believe that this is due to the fact that the emails were drag and dropped at some point from one folder to another (instead of using the "Move" functionnality of Outlook).

    When displaying the header, it seems that there are some Outlook specific date informations that are not used by other mail clients but that are used by Outlook in the list view. Is there a way to remove those headers so that the date appear correctly in the list?

    Thank you.

    Regards,

    Jimmy

    PS: Please find below the headers of the email that is used in the screenshot. (I have hidden email addresses for privacy purposes but you should get the idea)

    Delivered-To: q*****@gmail.com
    Received: by 10.96.228.65 with SMTP id sg1csp36065qdc;
    Fri, 17 Jan 2014 09:53:26 -0800 (PST)
    X-Received: by 10.140.42.180 with SMTP id c49mr5297570qga.24.1389981102510;
    Fri, 17 Jan 2014 09:51:42 -0800 (PST)
    Authentication-Results: mx.google.com;
    spf=softfail (google.com: best guess record for domain of transitioning multi*****@gmail.com does not designate [unknown] as permitted sender) smtp.mail=multi*****@gmail.com
    Received-SPF: softfail (google.com: best guess record for domain of transitioning multi*****@gmail.com does not designate [unknown] as permitted sender)
    Received: by 10.229.115.136 with POP3 id i8mf3304582qcq.2;
    Fri, 17 Jan 2014 09:51:42 -0800 (PST)
    X-Gmail-Fetch-Info: q*****@d-sight.com 5 mail.*****.com 110 q*****+*****.com
    Return-Path: [multi*****@gmail.com]
    From: "Multi Solutions IT Consulting" [s*****@msitconsulting.be]
    Sender: [multi*****@gmail.com]
    To: [i*****@d-sight.com]
    Subject: Informations de ventes D-sight et conditions
    Date: Tue, 20 Nov 2012 16:23:43 +0100
    Message-ID: [CADsVJsLOyKq9Og6d4=9dFgBSw-kmXnKa_+*****@mail.gmail.com]
    MIME-Version: 1.0
    Content-Type: multipart/alternative;
    boundary="----=_NextPart_000_1DF1C_01CF1391.9BA80820"
    X-Mailer: Microsoft Outlook 15.0
    Thread-Index: AQFemDM9YPQJ6VmrYTvUg/uB1UttGg==
    X-OlkEid: 00000000BD62B6AA883ACF4D920BFA1E5CECF9A60700A4BD200F77DE7943B6ED162FB69491E2000000000211
    Thursday, April 17, 2014 4:06 PM

Answers

  • Hello Jimmy,

    As far as I know Outlook doesn't provide any options in its UI for removing headers out of the box, only viewing them is possible. See How to View Internet Headers for more information.

    Also I have found the Implementing a Form Region to Display Email Headers in Outlook 2010 article in MSDN. It describes the way to get the transport headers:

    Outlook provides a PropertyAccessor interface that you can use to get and set built-in properties that are not exposed in the Outlook object model. Among these properties are those in the Messaging Application Programming Interface (MAPI) namespaces. The PidTagTransportMessageHeaders property is an example of these properties in the MAPI proptag namespace.

    The PidTagTransportMessageHeaders property specifies the transport-specific message header information for an email message. You can use the PropertyAccessor object to reference this property in the following format:

    http://schemas.microsoft.com/mapi/proptag/0x007D001E

    http://schemas.microsoft.com/mapi/proptag specifies the proptag namespace, 007d specifies the MAPI property identifier for this property, and 001E specifies a single-value or multiple-value property type of a null-terminated 8-bit (2-byte) character string.

    For ease of reading, use a constant to define the schema representation of the PidTagTransportMessageHeaders property as follows:

    string PidTagTransportMessageHeaders = @"http://schemas.microsoft.com/mapi/proptag/0x007D001E";

    To obtain the message header information for an email message, use the PropertyAccessor object exposed on the email message (by using the PropertyAccessor property), and use the GetProperty method to access the property as follows:

    message.PropertyAccessor.GetProperty (PidTagTransportMessageHeaders)

    Finally, I'd recommend asking non-programming questions in the Outlook IT Pro Discussions forum instead. The current forum is for developers.

    Friday, April 18, 2014 7:16 AM

All replies

  • Hello,

    You can edit headers using the PropertyAccessor object (see the corresponding property of the MailItem class). The name of the MAPI property is PR_TRANSPORT_MESSAGE_HEADERS . The DASL scheme is http://schemas.microsoft.com/mapi/proptag/0x007D001F .

    Also you may find the How To Obtaining the SMTP Header for a MAPI Message article helpful.


    Thursday, April 17, 2014 4:25 PM
  • PropertyAccessor won't allow you to edit PR_TRANSPORT_MESAGE_HEADERS. Outlook treats a number of properties as read-only in PropertyAccessor to maintain its business logic. One would have to use Extended MAPI or Redemption to change that property.

    Ken Slovak MVP - Outlook

    Thursday, April 17, 2014 8:20 PM
    Moderator
  • Ohhh... I almost forgot about this. The PropertyAccessor object tries to keep Outlook bussines logic in sync, so such operations are forbidden. Thank you for reminding, Ken.

    Anyway, the article I mentioned above provides a sample code where Extended MAPI calls are used:

       //  GetHeader takes a LPMESSAGE and returns a CString containing
       //  the header for the message.
    
       CString GetHeader(LPMESSAGE poEnv)
       {
         CString      csHeader;
         HRESULT         hr;
         LPSPropValue   lpProps = NULL;
    
         // MAPI property creation flags
         const ULONG ulFlags = MAPI_BEST_ACCESS | MAPI_DEFERRED_ERRORS;
    
         hr = HrGetOneProp(poEnv,PR_TRANSPORT_MESSAGE_HEADERS,&lpProps);
         if (S_OK == hr)
        {
           csHeader = lpProps[0].Value.lpszA;
        }
        return csHeader;
       }
    

    Thursday, April 17, 2014 8:48 PM
  • Thank you. Initially, I was actually trying to find an answer from a end-user perspective (i.e. using Outlook by itself rather than having to do this programmatically)... I guess however that I might not have a choice. 

    Thanks again.

    Friday, April 18, 2014 6:21 AM
  • Hello Jimmy,

    As far as I know Outlook doesn't provide any options in its UI for removing headers out of the box, only viewing them is possible. See How to View Internet Headers for more information.

    Also I have found the Implementing a Form Region to Display Email Headers in Outlook 2010 article in MSDN. It describes the way to get the transport headers:

    Outlook provides a PropertyAccessor interface that you can use to get and set built-in properties that are not exposed in the Outlook object model. Among these properties are those in the Messaging Application Programming Interface (MAPI) namespaces. The PidTagTransportMessageHeaders property is an example of these properties in the MAPI proptag namespace.

    The PidTagTransportMessageHeaders property specifies the transport-specific message header information for an email message. You can use the PropertyAccessor object to reference this property in the following format:

    http://schemas.microsoft.com/mapi/proptag/0x007D001E

    http://schemas.microsoft.com/mapi/proptag specifies the proptag namespace, 007d specifies the MAPI property identifier for this property, and 001E specifies a single-value or multiple-value property type of a null-terminated 8-bit (2-byte) character string.

    For ease of reading, use a constant to define the schema representation of the PidTagTransportMessageHeaders property as follows:

    string PidTagTransportMessageHeaders = @"http://schemas.microsoft.com/mapi/proptag/0x007D001E";

    To obtain the message header information for an email message, use the PropertyAccessor object exposed on the email message (by using the PropertyAccessor property), and use the GetProperty method to access the property as follows:

    message.PropertyAccessor.GetProperty (PidTagTransportMessageHeaders)

    Finally, I'd recommend asking non-programming questions in the Outlook IT Pro Discussions forum instead. The current forum is for developers.

    Friday, April 18, 2014 7:16 AM