Ich habe festgestellt, daß es an der Art, WIE die Regeln (de-)aktiviert werden, liegt. Wir hatten das Problem, daß der Inhalt des Empfängerfeldes bei mehmaligem Aktivieren/Deaktivieren über die Maske verloren ging. Hintergrund ist ein nicht ganz sauberer Cleanup der $FilterFormulas im Kalenderprofil, wo die Eintellungen hinterlegt sind.
Am besten, Ihr versteckt das Feld in der Mail Rule Maske, in dem festgelegt wird, ob die Regel (in-)aktiv ist. So muß der Benutzer immer über die Aktion in der Ansicht gehen, und dort arbeitet es relativ zuverlässig.
Hier mal ein Script zum Zurücksetzen der Regeln nach Löschung dieser. (Schließlich kann ja das Profildokument nicht wissen, wenn Du eine Regel löscht). Also - erst Regeln alle löschen, dann Code (im Button oder so) ausführen...
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Set db=s.CurrentDatabase
Dim doc As NotesDocument
Set doc = db.GetProfileDocument("CalendarProfile")
Dim anz As NotesItem
Set anz = doc.getfirstitem("$FilterFormulaCount")
anz1 = anz.Values(0)
anz2= Cint(anz1)
Dim FF As NotesItem
Set ff = doc.GetFirstItem("$FilterFormula")
Call ff.Remove
Set ff = doc.GetFirstItem("$FilterFormulaCount")
Call ff.Remove
For x=1 To anz2
anz3 = Cstr(x-1)
itembez = "$FilterFormula_"+anz3
Set ff = doc.GetFirstItem(itembez)
Call ff.Remove
Next
Call doc.save(True,False)
End Sub
Grüße
René
Edit:
Habe damals noch irgendwo was zur Funktionsweise Mailrules gefunden (Vielleicht nice 2 know)
To allow users to use Mail Rules:
Edit the Server document. The "allowed to use monitors" field should be set to * or should list the users allowed to use Mail Rules.
NOTE: Mail Rules have nothing whatsoever to do with Agents. Users do not need the ability to run agents on the server to use Mail Rules.
Mail Router
Just before a new email is saved in the mail database, the Router task on the server looks at the CalendarProfile document stored in that database. This
special document has hidden fields called $FilterFormula_xx.
Note that the individual "Mailrule" documents are not used by the Mail Router. Only the CalendarProfile is used. It's therefore possible that the CalendarProfile document may not reflect the individual Mailrule documents found in the database. For example, if you paste a Mailrule document in to the database, the CalendarProfile document is not updated, and the Mailrule document has no effect.
Mailrule documents
Each user's mail database contains a Folder called Rules. This will usually only contain documents created with the form "Mailrule". Keep in mind that this is a Folder and not a View. (Iris should change this to a View.) If there are other documents in this Folder, then the CalendarProfile may get an invalid $FilterFormula.
The Mailrule form calculates two hidden fields that are stored on all Mailrule documents: $FilterFormula and OrderNum. When the user clicks the Enable/Disable Rule(s) buttons, the CalendarProfile document is updated. Each Mailrule document is identified on the CalendarProfile as $FilterFormula_OrderNum.
If the user did a copy&paste of an existing Mailrule document, then there will be two Mailrule documents with the same value for the OrderNum field. When the CalendarProfile is updated, each Mailrule document will try to store their information in the same $FilterFormula_OrderNum field. One Mailrule document is therefore not added to the CalendarProfile. To correct this problem, use the MoveUp and MoveDown buttons (this changes the OrderNum field). This will ensure that all Mailrule documents have a unique OrderNum field.
If you're having trouble with Mailrules that are not working, or deleted Mailrules that are still being evaluated by the Mail Router, then remember:
1) The Mail Router looks at the CalendarProfile document only.
2) To recompute the CalendarProfile's $FilterFormula_xx fields, select all Mailrule documents in the folder and click the Disable Rule(s) button, then select all Mailrule documents again and click the Enable Rule(s) button. It's a good idea to use the MoveUp MoveDown buttons to make sure each Mailrule document has a unique OrderNum value.
Mailrules that MoveToFolder or CopyToFolder, store that folder's UNID as part of the $FilterFormula. You should therefore never paste a Mailrule from one database to another.