Last update (I hope)
   
    Michael M Slusarz
     
    slusarz@bigworm.colorado.edu
       
    Thu, 16 Aug 2001 22:32:24 -0600
    
    
  
Hopefully this will be the last time you hear from me :)  (And I'm not trying 
to be a little kid that needs to be walked through the process.  It's just that 
this patch would alter people's mailboxes in somewhat severe ways - as has been 
pointed out here before.  Also, it appears in a critical place (right after 
login) so it affects everyone if it is coded bad. so I want to make sure it 
looks good because it would be really cool if it gets stuck into the mainstream 
product.)
So, here come the pics again (yeah!).
1. http://bigworm.colorado.edu/imp-patches/5/picture1.png
Here is the confirmation screen again.  Preferences are as follows:
  'delete_sentmail_monthly' is locked (thus, it doesnt show up)
  'rename_sentmail_monthly' is turned off (it shows up, but is not checked)
  'purge_trash' is turned on (it shows up, and is checked)
I think this was the consensus idea from everyone on how this page should 
behave.  (BTW, the preferences screen for this setup is shown at 
http://bigworm.colorado.edu/imp-patches/5/picture3.png
2. http://bigworm.colorado.edu/imp-patches/5/picture2.png
This is what you get after you click on the 'Do Maintenance Operations' button.
In this case, only the Trash was purged - as you see it shows you the # of 
messages that were purged.
3. http://bigworm.colorado.edu/imp-patches/5/picture4.png
Finally, I went ahead and implemented not just monthly maintenance, but daily, 
weekly, and yearly also.  Jon posted something mentioning the idea of weekly 
tasks, so I built in the functionality to the class (BTW, most of this stuff is 
run out of a class called IMP_Maintenance).  I tried to make it as configurable 
as possible - so that if you wanted to implement in the future another 
maintenance operation, all you have to do is the following:
1. Make a new prefs entry (called PREFNAME) for the operation
2. [Optional] make a new prefs entry to set the interval - not needed, as you 
can just set a default interval in the class
3. Add two functions to IMP_Maintenance:
   'do_PREFNAME' - does the actual operation
   'descrip_PREFNAME' - returns info on the operation used to build the 
confirmation page
4. Add the PREFNAME to the tasks array at the top of IMP_Maintenance.
That's it (more detailed info is in the IMP_Maintenance class).  I realize that 
I may be way in over my head here by doing this - but this seemed the easiest 
way to allow future people to add functionality easily.  It's actually pretty 
cool - if you add new functions, you don't need to change prefs.php, 
maintenance.php, or mailbox.php.  Everything is dynamically handled by the 
class.  At least I think it's cool.  Then again, it has probably opened up a 
security hole the size of Mexico.
once again, i am going to check the code again and make sure it looks good 
before I try to send it in.
Do I have to be so long-winded about everything?  That's what a law school 
education gives you I guess :)
michael
_______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder