[Spambayes] [ spambayes-Bugs-677842 ] COM error on access denied

SourceForge.net noreply at sourceforge.net
Wed Mar 19 16:33:37 EST 2003


Bugs item #677842, was opened at 2003-01-31 10:21
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=677842&group_id=61702

Category: Outlook
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Tony Meyer (anadelonbrin)
Assigned to: Mark Hammond (mhammond)
Summary: COM error on access denied

Initial Comment:
Some folders (public ones in particular) may not allow 
the user access to create the spam field.  This also 
seems to cause an 'access denied' com error later on.  
An example traceback is below.

Warning: failed to create the Outlook user-property in 
folder 'MCN Newsletter'
 (-2147352567, 'Exception occurred.', (4096, 'Microsoft 
Outlook', "You don't have appropriate permission to 
perform this operation.", None, 0, -2147024891), None)
 This is probably because the code has recently been 
changed, but it will
 have no effect on the filtering or scoring.
AntiSpam: Watching for new messages in folder MCN 
Newsletter
AntiSpam: Watching for new messages in folder Inbox
AntiSpam: Watching for new messages in folder Spam
Error processing missed messages!
Traceback (most recent call last):
  File "D:\CVS Modules\spambayes\Outlook2000
\addin.py", line 610, in OnConnection
    self.ProcessMissedMessages()
  File "D:\CVS Modules\spambayes\Outlook2000
\addin.py", line 884, in ProcessMissedMessages
  File "D:\CVS Modules\spambayes\Outlook2000
\addin.py", line 129, in ProcessMessage
    if msgstore_message.GetField
(manager.config.field_score_name) is not None:
  File "D:\CVS Modules\spambayes\Outlook2000
\msgstore.py", line 651, in GetField
    prop = self.mapi_object.GetIDsFromNames(props, 0)
[0]
com_error: (-2147024891, 'Access is denied.', None, 
None)


----------------------------------------------------------------------

>Comment By: Mark Hammond (mhammond)
Date: 2003-03-20 11:33

Message:
Logged In: YES 
user_id=14198

This has been fixed a while ago too - it was the same
problem that caused Hotmail messages to fail.  Please reopen
if you have problems.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-02-05 06:03

Message:
Logged In: YES 
user_id=552329

Of course I don't need to wait until mail arrives, I can 'filter 
now'...sigh (it is early yet, I'm not really awake).

I made the change and tried to filter a folder without write-
access.  This is what I got:

Warning: failed to create the Outlook user-property in 
folder 'MCN Newsletter'
 (-2147352567, 'Exception occurred.', (4096, 'Microsoft 
Outlook', "You don't have appropriate permission to perform 
this operation.", None, 0, -2147024891), None)
 This is probably because the code has recently been 
changed, but it will
 have no effect on the filtering or scoring.
Exception in thread Thread-1:
Traceback (most recent call last):
  File "D:\Python22\Lib\threading.py", line 408, in __bootstrap
    self.run()
  File "D:\Python22\Lib\threading.py", line 396, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "D:\CVS Modules\spambayes\Outlook2000
\dialogs\AsyncDialog.py", line 115, in thread_target
    self._DoProcess()
  File "D:\CVS Modules\spambayes\Outlook2000
\dialogs\FilterDialog.py", line 375, in _DoProcess
    self.filterer(self.mgr, self.progress)
  File "D:\CVS Modules\spambayes\Outlook2000\filter.py", 
line 85, in filterer
    this_dispositions = filter_folder(f, mgr, progress)
  File "D:\CVS Modules\spambayes\Outlook2000\filter.py", 
line 65, in filter_folder
    disposition = filter_message(message, mgr, all_actions)
  File "D:\CVS Modules\spambayes\Outlook2000\filter.py", 
line 15, in filter_message
    prob = mgr.score(msg)
  File "D:\CVS Modules\spambayes\Outlook2000
\manager.py", line 384, in score
    email = msg.GetEmailPackageObject()
  File "D:\CVS Modules\spambayes\Outlook2000
\msgstore.py", line 595, in GetEmailPackageObject
    text = self._GetMessageText()
  File "D:\CVS Modules\spambayes\Outlook2000
\msgstore.py", line 472, in _GetMessageText
    hr, data = self.mapi_object.GetProps(prop_ids,0)
com_error: (-2147024891, 'Access is denied.', None, None)

The more I think about it, the more I am of the opinion that 
filtering (and scoring) should not be allowed unless the user 
has write access to the folder.  This would be simple enough 
to implement I presume (somewhere in folderselector.py, a 
check to see that access is available when the user selects a 
folder).

This would also leave someone else to do public folder 
testing, since I don't have write access to any :)

Apologies again for the multiple messages - like I said, it's 
early :)

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-02-05 05:56

Message:
Logged In: YES 
user_id=552329

ack.  my stupid browser (because of my stupid actions) 
resent my comment many times.  my apologies.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-02-05 05:50

Message:
Logged In: YES 
user_id=552329

Hi Mark

I don't really want to do anything with public folders!  But 
there was a message (from Neale from memory) about a user 
having trouble so I tried playing round with them and got this 
problem.

I would want to filter a public folder that I didn't have write 
access to so that I could see/rank the spam scores I guess.  
Although the worthwhileness (is that a word? ;) of this does 
seem a bit dubious.  Maybe the 'solution' is to disallow all 
filtering on folders without write access?

I'll have a go repoducing the exception with the change in 
code and let you know how it goes.  I'll have to wait until 
about midday (NZ) for any mail to arrive in the public folder.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-02-05 05:49

Message:
Logged In: YES 
user_id=552329

Hi Mark

I don't really want to do anything with public folders!  But 
there was a message (from Neale from memory) about a user 
having trouble so I tried playing round with them and got this 
problem.

I would want to filter a public folder that I didn't have write 
access to so that I could see/rank the spam scores I guess.  
Although the worthwhileness (is that a word? ;) of this does 
seem a bit dubious.  Maybe the 'solution' is to disallow all 
filtering on folders without write access?

I'll have a go repoducing the exception with the change in 
code and let you know how it goes.  I'll have to wait until 
about midday (NZ) for any mail to arrive in the public folder.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-02-05 05:48

Message:
Logged In: YES 
user_id=552329

Hi Mark

I don't really want to do anything with public folders!  But 
there was a message (from Neale from memory) about a user 
having trouble so I tried playing round with them and got this 
problem.

I would want to filter a public folder that I didn't have write 
access to so that I could see/rank the spam scores I guess.  
Although the worthwhileness (is that a word? ;) of this does 
seem a bit dubious.  Maybe the 'solution' is to disallow all 
filtering on folders without write access?

I'll have a go repoducing the exception with the change in 
code and let you know how it goes.  I'll have to wait until 
about midday (NZ) for any mail to arrive in the public folder.

----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2003-02-04 23:01

Message:
Logged In: YES 
user_id=14198

Hi Tony,
  I didn't realize you were an antipode ;)

I'm wondering why you want to filter public folders that you
don't have write access to?  Or is the point that you can
*move* the message, just can't save fields?

Interestingly, your exception points at:
 if
msgstore_message.GetField(manager.config.field_score_name)
is not None: 

which implies that this error is actually on the *following*
message, not the one that is actually failing.  This does
make sense, as we pass mapi.MAPI_DEFERRED_ERRORS to all mapi
functions.  I'm wondering if you can easily repro this
exception?  If so, I would be interested to see what
changing msgstore.py, line 666 (eeek!!!) in current CVS from:

self.mapi_object.SaveChanges(mapi.KEEP_OPEN_READWRITE |
USE_DEFERRED_ERRORS)
to:
        self.mapi_object.SaveChanges(mapi.KEEP_OPEN_READWRITE)

has on this exception, and if indeed the exception is now
raised from the "save" operation rather than a following one.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=677842&group_id=61702



More information about the Spambayes mailing list