Q

Purging e-mail folders based on date

As a K-12 school district with 800 staff members, each with Lotus Notes e-mail accounts, getting users to clean up their basic folders (the inbox and sent folders) is difficult. During this summer, we want to automatically purge both folders for each user based upon a given date. What would be the best way to accomplish a purge using a selected date for both folders -- using the "Remove" option on the Sent folder items?
I know of a few organizations who have implemented this type of document "purge" in order to have documents located in either the sent folder or inbox to be automatically deleted after a given period of time.

I understand the logic behind it -- a document, for example, in the Inbox after a month is "stale." So those organizations

make users who want to keep e-mail move if from the inbox/sent folders within a certain timeframe and place it in another "personal" folder, otherwise the document is deleted.

Not that I agree with the logic -- I just understand it.

The easiest way to accomplish your task is to create a scheduled agent, which would cycle through all the documents located in the folders you have specified, and delete any documents that were created before your selected date.

Be aware the "Remove" method of LotusScript will delete the document (or place it in the trash if "soft deletions" are turned on). If you use the "RemoveFromFolder" method, the document will be removed from the folder, but will still be available in the "All Documents" and "Mail Threads" views.

Your agent would look something like this...

        Dim db As New NotesDatabase( "yourserver", "mail\themail.nsf" ) 
        Dim view As NotesView 
        Dim doc As NotesDocument 
        Dim docr As NotesDocument 'Temporary placeholder to delete document 
        Set view = db.GetView( "($Inbox)" ) 
        Set doc = view.GetFirstDocument 
        
        While Not(doc Is Nothing) 
                Set docr = doc 
                Set doc = view.GetNextDocument(doc) 
                If docr.Created < Datenumber( 2005, 7, 4 ) Then 
                        Call docr.Remove 
                End If 
        Wend 
Substitute Call docr.Remove, with Call doc.RemoveFromFolder( "($Inbox)") if your intention is just to "clean up" the inbox/sent folders, rather than deleting those e-mail messages.
This was first published in June 2005

Dig deeper on Lotus Notes Domino Administration Tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close