Rule activated even after deleting it

Hi Friend,One of the user was created a rule to send copy of his mail to other user when he is on leave using rule. He created the rule to send copy of his mail to his colleague. Now he has deleted the rule but still copy of his mail is going to other mail address(the address he mentioned in the rule). I delted all the agents from desinger and then replace design with the mail template even after that it is acivated. Why it is happening and how can I sort out such problem.

Thanks

Deepak

Subject: Rule activated even after deleting it

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.

if you delete a Rule document in the mail file, before disabling it, the calendar profile still has the field that stores the compiled version of that Rule, so it still runs

Subject: RE: Rule activated even after deleting it

Send this button to your user:

Sub Click(Source As Button)

Dim session As New NotesSession

Dim db As NotesDatabase

Dim workspace As New NotesUIWorkspace

Dim folder As NotesView



Set db = session.currentdatabase	

Set folder = db.GetView("(Rules)")





Dim calendarProfile As NotesDocument

Set calendarProfile = db.GetProfileDocument( "CalendarProfile" )





Forall item In calendarProfile.Items

	If( Lcase$(Left$(item.Name,15)) = "$filterformula_" ) Then

		Print "Cleanup " & item.Name

		Call item.Remove

	End If

End Forall





Call calendarProfile.Save( False, False )





Dim mailrule As NotesDocument

Set mailrule = folder.GetFirstDocument

While Not( mailrule Is Nothing )

	Call mailrule.ReplaceItemValue( "Enable","0" )

	Call mailrule.Save( True,False,True )

	

	Set mailrule = folder.GetNextDocument( mailrule )

Wend





Call workspace.OpenDatabase( db.Server, db.FilePath, "(Rules)" )



Messagebox "Ok." 

End Sub