I had a filter forwarding mails from the production system to my personal email address but now it’s not needed anymore. I removed the filter friday, but I still recieve the mails. How can I make it stop?
Subject: Script to disable mailrules
Hi,
you have to disable the rule first, then you can delete it. If you not disable the rule before, it’s still active.
I found this this script a while ago. It deactivates all mailrules(also rules, you cannot see in the view anymore) in a mail database:
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim profile As NotesDocument
Dim doc As NotesDocument
Dim rules As NotesView
Dim item As NotesItem
Dim server As String
Dim DBPath As String
Dim count As Integer
count = 0
server = ws.Prompt(PROMPT_OKCANCELEDIT, "Server", "Specify the name of the server that the DB with the bad rules is on.")
DBPath = ws.Prompt(PROMPT_OKCANCELEDIT, "DB Filepath", "Specify the filepath to the DB that needs to be fixed.")
Set db = New NotesDatabase(server, DBPath)
If Not db.IsOpen Then
Messagebox "The server or DBPath was entered incorrectly." & Chr(10) & "Server: " & server & Chr(10) & "DB Filepath: " & DBPath
Exit Sub
End If
Set profile = db.GetProfileDocument("CalendarProfile")
Set rules = db.GetView("Rules")
’ Disable all of the rules that there are. Period!!!
If Not profile Is Nothing Then
If rules.AllEntries.Count > 0 Then
Call profile.ReplaceItemValue("$FilterFormulaCount", Cstr(rules.AllEntries.Count))
Elseif profile.HasItem("$FilterFormulaCount") Then
Call profile.RemoveItem("$FilterFormulaCount")
End If
Forall items In profile.Items
If items.type = 1536 Then
If Lcase(Left(items.name,7)) = "$filter" Then
Call items.remove()
End If
End If
End Forall
Call profile.Save(True,True,True)
End If
’ Mark the bit on every rules document still present in the rules folder for disabled and be sure that the ordernum starts at 0
Set doc = rules.GetFirstDocument()
While Not doc Is Nothing
Call doc.ReplaceItemValue("Enable", "0")
Call doc.ReplaceItemValue("OrderNum",count)
count = count + 1
Call doc.Save(True,False,True)
Set doc = rules.GetNextDocument(doc)
Wend
Call rules.Refresh()
End Sub
Subject: Now it works
That’s just stupid!
Well, now it works (or rather stopped working). Thanks a lot! I would have never figured that out…