none
Send mails with DeleteAfterSubmit causes sync folder entry with Exchange Cached Mode RRS feed

  • Question

  • Hi,

    I started this question here http://social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/d36c3480-2f06-42db-b1f7-c174c81f0316/ and was asked to ask it here instead. So I do:

     

    The following sample shows a small repro of a problem I am facing in a COM Addin, which needs to send mails (no trojan, I promise ;-) ). But sending mails with OOM (Outlook Object Model) causes a sync error item for every mail sent with OOM.

    Precondition is using a MAPI Profile with enabled Exchange Cache Mode and setting the MailItem property DisableAfterSubmit to true.

    I use Outlook 2010 x86 SP1 (14.0.6025.1000; MSO 14.0.6106.5005) and connect to Exchange Server 2010 SP1 which should be at a pretty recent RU level (OWA e.g. shows 14.1.323 in the HTML sources)

    So here is the minimal repro sample which you can execute from Outlook 2010 VBA:

    Private Sub SendMailTest()
      Dim mail As MailItem
      Set mail = Application.CreateItem(olMailItem)
      mail.Subject = "test"
      mail.To = take.your@own.mail.address
      mail.DeleteAfterSubmit = True
      mail.Send
      Set mail = Nothing
      MsgBox "finished"
    End Sub
    


    Shortly after I executed the script the mail arrived at the given destination inbox. So far so good.

    I can see that no copy of that mail is created in my sent items folder. Perfect.

    But a few seconds after the mail arrived (no matter if my or another mailbox is the destination) I get the following sync issue error in my sending mailbox:

    16:50:55 Synchronizer Version 14.0.6025
    16:50:55 Synchronizing Mailbox 'Carstensen, Sven'
    16:50:55 Synchronizing local changes in folder 'Postausgang'
    16:50:55 Uploading to server 'my.exchange.server'
    16:50:55 Synchronization of some deletions failed.
    16:50:55 		 [80070005-508-80070005-130]
    16:50:55 		 You do not have sufficient permission to perform this operation on this object.  See the folder contact or your system administrator.
    16:50:55 		 Microsoft Exchange Information Store
    16:50:55 		 For more information on this failure, click the URL below:
    16:50:55 		 http://www.microsoft.com/support/prodredirect/outlook2000_us.asp?err=80070005-508-80070005-130
    16:50:55 	   1 item(s) deleted in online folder
    16:50:55 Done
    


    While typing this question a background thread in my head kept thinking and made me do another test before submitting this issue:

    Same issue using Outlook GUI only: create a new mail item from the ribbon, enter some recipient and a subject. Before clicking on send you need to uncheck the message option "Save copy of sent message" which you can find in the mail window's Ribbon > Message > Tags and click on the little arrow on the bottom right corner of the Tags group. Uncheck the "Save copy of sent message" option, close the message options dialog and send the mail. A few seconds after the item was sent, I saw the same sync issue item as with my code.

    To be sure that no other add-ins are causing this, I disabled all add-ins except Exchange Add-in and VBA add-in.

     

    Can this sync issue be avoided?

     

    It fills the mailboxes of our customer's users and our support incident numbers with our customers.

     

    BTW: We switched all our mail sending code from Extended MAPI to OOM because sending mails with MAPI from within a C++ COM Add-in caused all sent items to stick in the outbox since Outlook MAPI switched to a tightly coupled provider. As a work around we triggered a sync group through OOM (to simulate an F9 click) to really push the items out of the outbox but that seems to hang Outlook's GUI thread in large mailboxes used in Cached Mode. So other issues but bad issues as well. When we started this message based request mechanism back with Exchange Client 5 and Outlook 97 we thought using message sending would be a great and easy idea - not so convinced about that anymore ;-)

    Can that mail submission be done in a more Outlook (>= 2003) compatible way?



    -- SvenC
    • Moved by Gavin-ZhangModerator Thursday, October 20, 2011 3:00 AM development related (From:Clients)
    Wednesday, September 28, 2011 2:25 PM