none
Ps_Internet_Headers and Pr_sent_representing_Adddres are present when emails are sent from Native IOS Mail App RRS feed

  • Question

  • Hi All,

    Why Transport Headers are added when email is sent from IOS devices. Though we don't this behavior in Outlook Desktop Client and Outlook Web.

    Another doubt is  PS_INTERNET_HEADERS and PR_SENT_REPRESENTING_SMTP_ADDRESS_W are present in sent item emails when emails are sent from Blackberry Mail App client on IOS Mobile Phone.

    These properties are not present in sent email when sent from IOS Mail App or Outlook Desktop client.

    My question is how do we differentiate sent emails from Received emails and which property is common for all the these mail clients to search for emails with RES_EXISTS restriction?

    Thanks.


    Thopulou Associate Software Engineer(iManage)






    • Edited by D thopulou Thursday, October 29, 2020 5:05 PM
    Tuesday, September 1, 2020 10:01 AM

Answers

  • The only reliable way to distinguish between sent and received emails is the presence of the PR_RECEIVED_BY_xyz properties (ReceivedByName / ReceivedOnBehalfOfEntryID / ReceivedOnBehalfOfName in OOM)

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

    • Marked as answer by D thopulou Tuesday, October 20, 2020 6:45 AM
    Monday, October 19, 2020 3:29 PM

All replies

  • The only reliable way to distinguish between sent and received emails is the presence of the PR_RECEIVED_BY_xyz properties (ReceivedByName / ReceivedOnBehalfOfEntryID / ReceivedOnBehalfOfName in OOM)

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

    • Marked as answer by D thopulou Tuesday, October 20, 2020 6:45 AM
    Monday, October 19, 2020 3:29 PM
  • Hi Dmitry,

    This works when email is sent from Outlook Desktop client as you mentioned PR_RECEIVED_BY_xyz is not present in sent items.

    But if the email is sent from Outlook App in Android and Mail App in IOS mobile phone, PR_RECEIVED_BY_xyz is present. we have clients filing emails from mobile apps(using Blackberry Mail App)

    I am attaching the screent shots.

    from Android

    From IOS mobile phone:


    Thopulou Associate Software Engineer(iManage)

    Tuesday, October 20, 2020 8:49 AM
  • If that was up to me, I'd start with the parent folder (Sent Items vs Inbox) using MailItem.Parent and compare its entry id with the entry id of the default folder (Namespace.GetDefaultFolder) using Namespace.CompareEntryIDs. If you have anything but Sent Items or Inbox, you can look at the PR_RECEIVED_BY_xyz properties.

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

    Tuesday, October 20, 2020 4:47 PM
  • Hi Dmitry,

    How do we distinguish the sent items and received items by comparing the entry id. if you Could you share some code snippet that would be very helpful.

    Since PR_RECEIVED_BY_xyz is present in Sent items if email is sent from Mobile mail Apps I feel using it won't be able to filter out all sent items from all the Mail clients.

    Thank you for being so helpful every time!!!!!


    Thopulou Associate Software Engineer(iManage)

    Tuesday, October 20, 2020 7:49 PM
  • As I described above:

    1. Get the parent folder - read MailItem.Parent and cast it to MAPIFolder

    2. Read MAPIFolder.EntryID

    3. Retrieve the Sent Items folder using Namespace.GetDefaultFolder(olFolderSentMail), read its EntryID property.

    4. Compare #2 and #3 using namespace.CompareEmtryIDs.

    5. Do the same for olFolderInbox.


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

    Tuesday, October 20, 2020 8:08 PM
  • Hi Dmitry,

    Thank you the help and suggestions but unfortunately this approach is not working for Search Folder.

    We are moving the emails to Search Folder with restrictions depending on MAPI Property. But this approach is also not a complete fix as all mail clients (native Apple mail, Outlook for iOS, native mail for Android, Outlook for Android, BlackBerry mail, etc.) have different MAPI Properties. Is there any MAPI Property that will be common for all the mail clients?

    IS there any Standard way that certain MAPI Property should be stamped or should not be stamped?

    Your suggestion in this regard will be so helpful again.

    We are filtering email emails to file by different features and we are fetching items from Search Folder

    Thanks a ton for always helping out.


    Thopulou Associate Software Engineer(iManage)


    • Edited by D thopulou Thursday, October 22, 2020 4:16 PM
    Thursday, October 22, 2020 4:10 PM
  • MailItem.Parent returns the real parent folder. Search folders do no contains items, so search folder is never returned from MailItem.Parent.

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

    Thursday, October 22, 2020 6:50 PM
  • Hi Dmitry,

    What I meant by Search Folder is, we create our own Search Folder(Say MySearchFolder) under Root with Search Criteria so that emails from Sent items folder and Inbox will be in our Search Folder. And accordingly we fetch emails from Search Folder to file emails.

    So my question is how do we set Search Criteria(Restrictions) so that sent items will be in our Search Folder?

    Currently what this is how we are setting search criteria for Sent Items: which does not have transport headers.

    lpRes->rt = 0x2 = RES_NOT
    lpRes->res.resNot.ulReserved = 0x00001000
    lpRes->res.resNot.lpRes
    lpRes->rt = 0x8 = RES_EXIST
    lpRes->res.resExist.ulPropTag = 0x007D001E (PT_STRING8): PR_TRANSPORT_MESSAGE_HEADERS: (PR_TRANSPORT_MESSAGE_HEADERS_A, PR_TRANSPORT_MESSAGE_HEADERS_W, PidTagTransportMessageHeaders)
    lpRes->res.resExist.ulReserved1 = 0x00000000
    lpRes->res.resExist.ulReserved2 = 0x00000000

    But when we sent emails from IOS mobile, Sent Items has PR_TRANSPORT_MESSAGE_HEADERS. 

    And when we sent emails from Blackberry Mail App, Ps_Internet_Headers and Pr_sent_representing_Adddres are present in sent items.

    How do we distinguish Sent Items? Is there any any MAPI Property that we can use apart from PR_ReceivedBy_XYZ?

    Thanks again!


    Thopulou Associate Software Engineer(iManage)


    • Edited by D thopulou Thursday, October 22, 2020 7:27 PM
    Thursday, October 22, 2020 7:26 PM
  • You can retrieve or create a restriction on the PR_PARENT_ENTRY_ID property.

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

    Thursday, October 22, 2020 9:20 PM
  • Hi Dmitry,

    I compare the properties of Sent Item and Received item both has PR_PARENT_ENTRY_ID. So Sent items and Received items will be retrieved if we use PR_PARENT_ENTRY_ID. we are interested only in Sent Items.

    So I think PR_PARENT_ENTRY_ID is also not a reliable property.

    Could you suggest again.

    Thanks!!!


    Thopulou Associate Software Engineer(iManage)

    Tuesday, October 27, 2020 9:28 AM
  • Of course all items expose the PR_PARENT_ENTRY_ID property. I thought you were trying to determine from a search folder  contents table where a particular items is actually located.

    I thing you are missing my point - your first criteria must the parent folder (Inbox vs Sent Items). If it is some other folder, you can check the PR_RECEIVED_BYX_XYZ or PR_TRANSPORT_HEADERS property. It is not 100% reliable, but that's the best you can do.


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

    Tuesday, October 27, 2020 4:14 PM
  • Thank you So  much Dmitry

    Thopulou Associate Software Engineer(iManage)

    Friday, October 30, 2020 6:52 PM