I am looking for some sort of agent that will remove attachments from (all)users Mailbox ideally leaving some sort of text saying the attachment has been archived.
I know this is possible using thirdparty archive tools but in theory should be possible via agent. I could use the domino in built archiving tools however we are using a third-party cloud based archiving system that is journaling all our mail I require some sort of mechanism to reduce the size of the mailboxes on the domino server.
Morning Barry, yes have looked at DAOS. We are using a third party archiving journal solution which users can retrieve emails/attachments from fully indexed and searchable. No need for the attachments to be in the mailbox.
Write an agent that loops though all mailboxes on the server.
Here is a code snippet from a similar application, with some small modifications for you:
Dim col As MailFileCollection
Dim cnt As Integer
Dim filename As String
'*** Load all mailfiles
Set col = New MailFileCollection()
cnt = col.LoadAllMailFiles(“YourServer/Domain”)
'*** Loop though all mailfiles and extarct attachments
ForAll m In col.mailfile
Call DetachAllAttachments(m)
End ForAll
Now you just have to create the function DetachAllAttachments(db as NotesDatabase).
Simply loop through all documents in the database and use the ExtractFile method of the NotesEmbeddedObject class to detach the files to disk, then use the Remove method to delete the attachment.
If you want to replace the attachment with text, use the NotesRichTextNavigator class to locate the attachment using the FindFirstElement/FindNextElement, then use GetElement to get the attachment. I haven’t done it this way myself, but I would imagine you use the SetBegin method of the NotesRichTextRange to get the element and then set the text.
Thanks Karl-Henry and Barry for your suggestions. Karl-Henry that gives me something to work on. Barry yes I have looked at DAOS but it is not something I am looking to implement just yet.