xp_readmail and Exchange 2016

  • Hi All-

     Ive inherited an older system that uses a custom stored procedure to read email from an inbox (using SQLMail - NOT database mail) then insert the contents of the email into a table.  This is on a SQL 2008 R2 system and we were using exchange 2010 up until today.

    The team has been migrating from Exchange 2010 to Exchange 2016. As soon as the mailbox that we use SQL and xp_readmail to process mail from is migrated to the Exchange 2016 we run into issues.  The SP still runs, however it doesnt read the body of the email.  This works fine when the mailbox is on Exchange 2010.  Knowing that SQLMail uses a local Outlook Profile, this is a bit perplexing to me as Im thinking the version of exchange shouldn't matter.  Outlook versions did not change.

    Now, I know, I know... SQLMail is no longer supported and hasnt been for a very long time and we need to move to other software/tech for this but we are in a pinch and not able to move away from SQLMail at the moment. This is the only mailbox preventing us from decommissioning the Exchange 2010 server and people want that server gone.

    Can anyone help me get some insight into why xp_readmail would read the body of the mail (@message) when the mailbox is on Exchange 2010, but not when its on Exchange 2016?  The rest of the fields seem to function correctly.  Ive been able to reproduce this on a test system that Im using to troubleshoot.

    Thanks much!

  • roby 54685 - Friday, March 17, 2017 9:04 PM

    Hi All-

     Ive inherited an older system that uses a custom stored procedure to read email from an inbox (using SQLMail - NOT database mail) then insert the contents of the email into a table.  This is on a SQL 2008 R2 system and we were using exchange 2010 up until today.

    The team has been migrating from Exchange 2010 to Exchange 2016. As soon as the mailbox that we use SQL and xp_readmail to process mail from is migrated to the Exchange 2016 we run into issues.  The SP still runs, however it doesnt read the body of the email.  This works fine when the mailbox is on Exchange 2010.  Knowing that SQLMail uses a local Outlook Profile, this is a bit perplexing to me as Im thinking the version of exchange shouldn't matter.  Outlook versions did not change.

    Now, I know, I know... SQLMail is no longer supported and hasnt been for a very long time and we need to move to other software/tech for this but we are in a pinch and not able to move away from SQLMail at the moment. This is the only mailbox preventing us from decommissioning the Exchange 2010 server and people want that server gone.

    Can anyone help me get some insight into why xp_readmail would read the body of the mail (@message) when the mailbox is on Exchange 2010, but not when its on Exchange 2016?  The rest of the fields seem to function correctly.  Ive been able to reproduce this on a test system that Im using to troubleshoot.

    Thanks much!

    Probably because the MAPI and CDO libraries went away with Exchange 2016.
    So it may be that you really need to switch over to Exchange Web Services. Soon.

    Sue

  • Hey Sue-
      I ran across that as well in the "Discontinued items in Exchange 2016" article, though Im not sure that is related exactly to SQLMail, even though it uses MAPI. What Im struggling to understand though, is that xp_readmail executes successfully and pulls in other information, but not the body (@message).  Take a look at the image attached. So its "working" but just not that field.  Also, Ive researched the MAPI/CDO library and what will show in the logs if an unsupported connection comes into exchange and Im not seeing the error messages - its says just the opposite that the connection occurred and was accepted.

  • roby 54685 - Monday, March 20, 2017 6:38 AM

    Hey Sue-
      I ran across that as well in the "Discontinued items in Exchange 2016" article, though Im not sure that is related exactly to SQLMail, even though it uses MAPI. What Im struggling to understand though, is that xp_readmail executes successfully and pulls in other information, but not the body (@message).  Take a look at the image attached. So its "working" but just not that field.  Also, Ive researched the MAPI/CDO library and what will show in the logs if an unsupported connection comes into exchange and Im not seeing the error messages - its says just the opposite that the connection occurred and was accepted.

    I wouldn't expect libraries that are no longer available or supported to work properly. xp_readmail has been listed as being deprecated for quite awhile - with SQL 2008 docs, it was already saying to modify any applications using it. SQLMail only available in 2008 for backwards compatibility. Three pieces in that chain aren't suppose to be used anymore. It just doesn't make sense to me to put energies into going down this path when should have been on modifying the procedures for a quite a long time.

    Sue

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply