E-mail logging and what to do when upgrading to a new release of Exchange Server or when moving the current Exchange Server to new hardware

E-mail logging and what to do when upgrading to a new release of Exchange Server or when moving the current Exchange Server to new hardware

Rate This
  • Comments 0

Microsoft Dynamics NAV technical support sometimes gets involved regarding request for E-mail logging assistance after an Exchange Server was migrated from old to new hardware or when the original Exchange Server was upgraded to a later release. Starting in Exchange 2007, the underlying OS should be 64-bit which means that new hardware needs to be purchased and the question then comes up how to migrate the old Exchange Server database to the new one. Some customer decide to use tools like Exmerge (PST migration method) or a similar approach.

This however breaks the entry ID’s and store ID’s that are needed to link the interaction log entries with the E-mails that are stored in the STORAGE folder on the Exchange Server.

The way to preserve the correct ID’s is to establish Public Folder replication / Move Mailbox methods. E-mail logging will be functional after the move to the newly created Exchange Server and old and new interactions of type E-mail can be shown without troubles utilizing Office 2003 and Office 2007. If a different migration scenario was chosen, the only way forward is to move the stored E-mails from STORAGE folder to the QUEUE folder (on the new Exchange Server). This of course becomes tricky if the logged E-mails do not contain correct E-mail addresses or do now contain X500 addresses. The current advice is to file a support call with Microsoft Dynamics NAV technical support for further assistance.

However, we now also see a couple of new scenario’s when 32-bit and 64-bit Office 2010 comes into the working place as well. When Office 2010 is added to the environment, an update is required:
2291071    "This e-mail has been deleted" error message if you use the "E-mail Logging" feature in Microsoft Dynamics NAV 2009 SP1 together with Microsoft Office 2010
https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;EN-US;2291071

Furthermore, you could have a look at the following blog:
http://blogs.msdn.com/b/nav/archive/2010/08/20/microsoft-dynamics-nav-compatibility-with-microsoft-office-2010-and-microsoft-sharepoint-2010.aspx

After Exchange Server migration, there are problems with old and new Interaction Log Entries when using a mixture of 32-bit Office 2010 and 64-bit Office 2010.
On 32-bit Office 2010, only the older logged E-mails do not open successfully. Newly logged E-mails do open successfully.
On 64-bit Office 2010, only the new logged E-mail do not open successfully. older logged E-mails do open successfully.

This has been reproduced by Microsoft. The workaround to move the logged E-mails from STORAGE folder to QUEUE folder, does not really apply here.

The cause of this problem is due to two issues.

  • In the database, the old records in table 5062 (“Attachments”) has a field called Store Pointer ID which is still pointing to the old machine running Exchange 2003, and not the machine running Exchange 2010.
  • On the client, a component of Outlook caches these Store Pointer IDs when accessed through the API used in NAV, even though the client has been configured to use the new Exchange server.

Resolution steps

  1. Apply KB 2291071.
  2. Ensure that mails can be logged (but not necessarily shown) before continuing.
  3. Disable "Use Cached Exchange Mode" on both a 64-bit and 32-bit Outlook client and ensure that the mails logged after the Exchange upgrade can now be shown from the interaction log.

Once the above steps have been ensured, configure the clients which are experiencing the issue in either one of the following ways:

  1. Permanently disable the "Use Cached Exchange Mode" if the customer does not care about the cached mode features.
  2. OR ELSE delete and recreate the users Outlook Profile in Mail in the Control Panel.

Once the clients are configured correctly, apply the following steps only once to update the database so that the records in table 5062 point to the new Exchange server:

  1. Take a backup of the database.
  2. Identify the most recently logged e-mail (which is therefore logged as being on the new Exchange server) by running table 5062 from C/SIDE and noting the "No." field of the record with the highest value in "No.", which has "Storage Type" being "Exchange Storage".
  3. Import the code unit below, adjust the line containing "BaseAttachment.GET" to the number found above, and run it.

OBJECT Codeunit 10000 Update attachment IDs
{
  OBJECT-PROPERTIES
  {
    Date=;
    Time=;
    Version List=;
  }
  PROPERTIES
  {
    OnRun=VAR
            Attachment@1170000000 : Record 5062;
            BaseAttachment@1000000000 : Record 5062;
            TransferInStream@1000000001 : InStream;
            TransferOutStream@1000000002 : OutStream;
          BEGIN
            // define here what attachment (in table 5062) has a correct and working Store Pointer ID
            BaseAttachment.GET(31);

            IF Attachment.FIND('-') THEN
              REPEAT
                IF Attachment."Store Pointer ID".HASVALUE AND (Attachment."No." <> BaseAttachment."No.") THEN BEGIN
                  BaseAttachment.CALCFIELDS("Store Pointer ID");
                  BaseAttachment."Store Pointer ID".CREATEINSTREAM(TransferInStream);
                  Attachment.CALCFIELDS("Store Pointer ID");
                  Attachment."Store Pointer ID".CREATEOUTSTREAM(TransferOutStream);
                  COPYSTREAM(TransferOutStream, TransferInStream);
                  Attachment.MODIFY;
                END
              UNTIL Attachment.NEXT = 0;

            MESSAGE('Attachment Store Pointer IDs were updated');
          END;

  }
  CODE
  {

    BEGIN
    END.
  }
}

Regards,

Marco Mels
CSS EMEA

This posting is provided "AS IS" with no warranties, and confers no rights

Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post