Delete Old email with Agent

I am trying to delete all email previous to 2009 from a users mail box. How can I create an agent that will go through that users mailbox (all docs folder) and delete all email previous to 2009?

Subject: replication options, or lotusscript

The easiest thing to do is to select the mailfile, then go to replication options, space savers. Select “Remove documents not modified in the last (days) __” and put in 502. (That’s 137 days since 1/1/2010 + 365 days before that.) Click OK and wait thru the hourglass.

If you don’t want to do it that way, or if you wanted to check to be sure it was email not calendar, then you could write a lotusscript agent. First, make sure that you have delete access to the user’s mailfile. Then you’ll want to use lotusscript to grab the “all documents” view ( Set userview=db.GetView( “($All)”).

Then do something to compare the date to see if it is older than 01/01/2009 (use notesdatetime). Finally, check to see if Form=“Memo” if you don’t want to delete calendar and todo docs.