none
Outlook form writing to SMTP header, readable by POP RRS feed

  • Question

  • I have an outlook form with some embedded VBS, currently the following:

    Sub Item_Write()
    	Set oPA = Item.PropertyAccessor 
    	oPA.SetProperty "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/NewProp", "Testing"
    
    End Sub
    

    If i view the internet headers in Outlook, I see a field called NewProp with a value of 'Testing'

    When I telnet to the POP port, do a retr <ID>, It isn't there...

    What do I need to do to get an SMTP header thats in the SMTP header rather than in 'winmail.dat' (which i assume is where this is landing?)

    Tuesday, April 16, 2013 3:53 AM

Answers

  • The custom MAPI property is converted to a MIME header when the message is actually sent through the SMTP layer. In your case that never happens.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    • Marked as answer by BotTT Tuesday, April 16, 2013 6:22 AM
    Tuesday, April 16, 2013 6:03 AM

All replies

  • If you download that message to Outlook, what do you see for that message in the PR_TRANSPORT_MESSAGE_HEADERS MAPI property (download OutlookSpy, select the message in the Inbox, click the IMessage button)?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, April 16, 2013 4:03 AM
  • Thanks for the prompt attention...

    That field matches what I see in the message properties page in outlook:

    Received: from <mailserver> (192.168.1.25) by
     mailserver2 (192.168.2.25) with Microsoft SMTP Server id
     14.2.342.3; Tue, 16 Apr 2013 13:31:28 +1000
    X-MimeOLE: Produced By Microsoft Exchange V6.5
    MIME-Version: 1.0
    Content-Type: application/ms-tnef; name="winmail.dat"
    Content-Transfer-Encoding: binary
    Content-Class: urn:content-classes:message
    Subject: Subject
    Date: Tue, 16 Apr 2013 13:31:27 +1000
    Message-ID: <2105E900D5BB0B4AB2A443443C5BFECD032BC346@<mailserver>>
    X-MS-Has-Attach:
    X-MS-TNEF-Correlator: <2105E900D5BB0B4AB2A443443C5BFECD032BC346@<mailserver>>
    Thread-Topic: Subject
    Thread-Index: Ac46UuD/RSzZQa6BTouRxoOxex7pNA==
    From: Me <me@domain.com>
    newprop: Testing
    To: <Test.mailbox@domain.com>, <me@domain.com>
    Return-Path: me@domain.com
    X-MS-Exchange-Organization-SCL: -1
    X-MS-Exchange-Organization-AuthSource: mailserver2
    X-MS-Exchange-Organization-AuthAs: Internal
    X-MS-Exchange-Organization-AuthMechanism: 0b

    what I see via POP is:

    retr 10
    +OK
    Received: from <mailserver> (192.168.1.25) by
     mailserver2 (192.168.2.25) with Microsoft SMTP Server id
     14.2.342.3; Tue, 16 Apr 2013 13:31:28 +1000
    From: Me <me@domain.com>
    To: Test Mailbox <Test.Mailbox@domain.com>, Me
            <me@domain.com>
    Subject: Subject
    Thread-Topic: Subject
    Thread-Index: Ac46UuD/RSzZQa6BTouRxoOxex7pNA==
    Content-Class: urn:content-classes:message
    Date: Tue, 16 Apr 2013 13:31:27 +1000
    Message-ID:
     <2105E900D5BB0B4AB2A443443C5BFECD032BC346@<mailserver>>
    Content-Language: en-US
    X-MS-Exchange-Organization-AuthAs: Internal
    X-MS-Exchange-Organization-AuthMechanism: 0b
    X-MS-Exchange-Organization-AuthSource: mailserver2
    X-MS-Has-Attach:
    X-MS-Exchange-Organization-SCL: -1
    X-MS-TNEF-Correlator:
    Content-Type: text/html; charset="us-ascii"
    MIME-Version: 1.0
    

    Tuesday, April 16, 2013 4:29 AM
  • Are you sure you are retrieving the same message? Outlook uses the same POP3 protocol to retrieve it, does it not?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, April 16, 2013 4:53 AM
  • yep, same message, i only changed the server names and identifiable user named - the message ID matches

    Its an exchange server and Outlook is using MAPI... but thats a good point, i'll hit it with outlok using POP3 and see how it shows up

    Tuesday, April 16, 2013 5:42 AM
  • PR_TRANSPORT_MESSAGE_HEADERS, in Outlook connectyed by POP3, matches what I download via telnet...

    The custom field is missing

    So I'm back to the root question of, how do I put a custom property into the SMTP header? ... seems PropertyAccessor is a MAPI thing... 

    Tuesday, April 16, 2013 5:50 AM
  • Are you sending through SMTP or Exchange?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, April 16, 2013 5:52 AM
  • Sending via Exchange, based on a form published to Exchange  Org Forms - I dont see how that can realistically change

    (as expected, IMAP also misses the field)

    Tuesday, April 16, 2013 5:59 AM
  • The custom MAPI property is converted to a MIME header when the message is actually sent through the SMTP layer. In your case that never happens.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    • Marked as answer by BotTT Tuesday, April 16, 2013 6:22 AM
    Tuesday, April 16, 2013 6:03 AM
  • I see... and I assume there no other way to trigger that conversion?
    Tuesday, April 16, 2013 6:22 AM
  • I don't think so... Essentially what you what is for the POP3 layer on the Exchange Server to do what the SMTP layer does - propagate some MAPI properties to the message headers. I don't think POP3 does that.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, April 16, 2013 6:27 AM