Mail files

Hello Forum,

My servers have several mail files where (due to size limitations and email retention agents) the Parent meeting has been deleted but the informational updates (the meeting emails with the “I” icon next to them) still exist.

Since the parent meeting is gone, the informational updates cannot be deleted. Many of them contain agenda items which can range from a few kb to several MB which takes up valuable space in the mail files.

Is there a way to remove these “orphan” files?

Thank you

Robbie O

Subject: $Ref

you can write an agent to find the orphans and remove them. Here’s the logic

create a document collection or a view to act on the orphan items

SELECT Form = “Notice” & @IsAvailable($REF)

Now cycle through the docs and lookup the parent document. The parent relates to the UNID in the $Ref field. If not found then delete the orphan.

NOTE: If you use GetDocumentByUNID you will need to “catch” the error this method witll throw if the parent document is not found. I don’t think IBM has fixed this yet.

On Error 4091 Resume Next ’ need this to handle Invalid Universal ID error

’ rdoc refers to response doc

’ pdoc refers to parent doc

Set pdoc = db.GetDocumentByUNID(rdoc.~$REF(0))

Subject: orphan meeting notice

ok, i tried the view formula and found one document with the ! next to it. I’m sure there should be more then that. If I check the ! document properties and find $REF field where is UID associated with parent doc?

I guess I’m not sure what I should be seeing.

Also, how do I delete the view? Cannot seem to remove it.

TY

robbie

Subject: orphan documents - remove view

ok, i figured out how to delete the view i created

Subject: mail file orphan docs

thank you for the response Paul.

so if i tried this line of code and searched for the parent document, if parent document does not show what IS found can be deleted?

I am more of an admin tech then a developer but have a general understanding of creating a view or agent on a DB.

TY.

RobbieO

Subject: maybe this

something like this should work, not tested

Sub Initialize

Dim ns As New NotesSession

Dim db As NotesDatabase

Dim ndc As NotesDocumentCollection

Dim rdoc As NotesDocument

Dim pdoc As NotesDocument

Dim tmpdoc As NotesDocument



Set db = ns.CurrentDatabase

sf$ = | SELECT Form = "Notice" & @IsAvailable($REF) |

Set ndc = db.Search(sf$, Nothing, 0)



If ndc.Count = 0 Then

	Print "no response documents returned by search"

	Exit Sub

End If



On Error 4091 Goto deldoc ' need this to handle Invalid Universal ID error

Set rdoc = ndc.GetFirstDocument

While Not rdoc Is Nothing

	Set tmpdoc = ndc.GetNextDocument(rdoc)

	Set pdoc = db.GetDocumentByUNID(rdoc.~$REF(0))

nxtdoc:

	Set rdoc = tmpdoc

Wend



Exit Sub

deldoc:

Call rdoc.RemovePermanently(True)

Resume nxtdoc

End Sub