The only thing I can suggest is to ensure that both notifications come on the same thread.  If 2 different threads call OnSave on the same object, then self.InEmail will not be reliable (although it still isn't clear how that would cause an empty subject).  From your code, it seems storing InEmail in self isn't necessary anyway...
 
Otherwise, try searching outside the Python universe - you may find the problem described and explained by someone using the exact same technique but using a different language.
 
Mark
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Johann Abraham
Sent: Tuesday, 5 September 2006 7:19 AM
To: python-win32
Subject: [python-win32] Exchange event

I wrote a small application for an exchange server to catch asynchronous save email invents on a particular exchange inbox.  Everything was working fine until a co-working pointed out that if two emails are sent to the inbox very quickly in succession (ie. automated), the application doesn't process the first email.  I know the email event is caught because the Url prints properly, but none of the Message Object data will print out.  I've included my OnSave function below and an example of the trace collecter output, as you can see in the trace collecter output self.InEmail.From doesn't print out the correct "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>.  I've spent a few days on this already so if anybody knows what I'm doing wrong, I'd really appreciate your help.

Johann

The process is:
class AutoPilot:
    _public_methods_ = IExStoreSyncEvents_methods  
    _com_interfaces_ = ['IExStoreAsyncEvents']


    _reg_clsid_      = "{D7CDBFB7-7B49-4EA4-9F8E-47152ED86991}"
    _reg_progid_     = "AutoPilot"
    _reg_desc_       = "QCM AutoPilot Response System"
       
        # IExStoreSyncEvents interfaces
    def OnSave(self, pEventInfo, strUrl, lFlags):
        'Called by a store when an item is saved.'

        self.ActionRequired = 'None'
        self.Confirmation = 'No'
       
        print strUrl
        self.InEmail = Dispatch("CDO.Message ")
        self.InEmail.DataSource.Open(strUrl,None,0x1,-1,0x800000,"","")
        print '****From'
        print self.InEmail.From
        print '******'


The trace collecter shows:

Object with win32trace dispatcher created (object=None)
in <emailFramework.AutoPilot instance at 0x00A5F0D0>._QueryInterface_ with unsupported IID IMarshal ({00000003-0000-0000-C000-000000000046})
in < emailFramework.AutoPilot instance at 0x00A5F0D0>._QueryInterface_ with unsupported IID {0000001B-0000-0000-C000-000000000046} ({0000001B-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5F0D0>._QueryInterface_ with unsupported IID IStdMarshalInfo ({00000018-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5F0D0>._QueryInterface_ with unsupported IID IExternalConnection ({00000019-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5F0D0>._QueryInterface_ with unsupported IID {4C1E39E1-E3E3-4296-AA86-EC938D896E92} ({4C1E39E1-E3E3-4296-AA86-EC938D896E92})
Object with win32trace dispatcher created (object=None)
in <emailFramework.AutoPilot instance at 0x00A5FD50>._QueryInterface_ with unsupported IID IMarshal ({00000003-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5FD50>._QueryInterface_ with unsupported IID {0000001B-0000-0000-C000-000000000046} ({0000001B-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5FD50>._QueryInterface_ with unsupported IID IStdMarshalInfo ({00000018-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5FD50>._QueryInterface_ with unsupported IID IExternalConnection ({00000019-0000-0000-C000-000000000046})
in <emailFramework.AutoPilot instance at 0x00A5FD50>._QueryInterface_ with unsupported IID {4C1E39E1-E3E3-4296-AA86-EC938D896E92} ({4C1E39E1-E3E3-4296-AA86-EC938D896E92})
in <emailFramework.AutoPilot instance at 0x00A5F0D0>._QueryInterface_ with unsupported IID {1C733A30-2A1C-11CE-ADE5-00AA0044773D} ({1C733A30-2A1C-11CE-ADE5-00AA0044773D})
file://./backofficestorage/kelsan.com/MBX/qcm-autopilot/Inbox/none- 21.EML
in <emailFramework.AutoPilot instance at 0x00A5FD50>._QueryInterface_ with unsupported IID {1C733A30-2A1C-11CE-ADE5-00AA0044773D} ({1C733A30-2A1C-11CE-ADE5-00AA0044773D})
file://./backofficestorage/kelsan.com/MBX/qcm-autopilot/Inbox/none- 22.EML
****From

******
****From
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
******
_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to