Question about rules problems and custom rules

L

Lionel Fourquaux

Hello!

[Questions at the end of the post]

I'm using a rule of this form:

for all incoming mails, run a script

The script is a VBA procedure that assigns the mail to a category
if it verifies some condition:

Sub MyAction(Item As MailItem)
If MyCondition(Item) Then
Item.Categories = "MyCategory"
Item.Save
End If
End Sub

The following rules move the mail to different folders, using criteria
based on email addresses, keywords and the category I tried to assign.
For these sorting rules, I'm using the "stop processing the following
rules" action (and I'm not using it for the first).

Here is what I see: the first rule works from time to time, but very
unreliably. The other rules work most of the time, except for checking
to category. It looks like some race condition, since computing
MyCondition(Item) takes more time that e.g. checking for keywords.

I've disabled the automatic send/receive operations, since there is
a known issue with rules in this case.

First question: is there some design flaw in this? (e.g. if scripts are called
asynchonously during rules processing).
Second question: does someone know of a precise problem with rules
that explains this behaviour? (precise enough to know when it is likely
to happen, and when it won't).
Third question: if I convert my VBA code to a COM (C++) custom rule,
is it likely to improve the situation, or should I try something else?

Thank you very much for your help!

-- Lionel Fourquaux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top