[Tutor] automatic account destruction

Kirk Bailey idiot1 at netzero.net
Sun Apr 18 02:09:00 EDT 2004


I give people free email accounts. From time to time, I have the task 
of searching for abandoned accounts and removing them, which is a time 
consuming chore. This is a bother, world class. So I am building a 
script which opens the first line of every email popbox and extracts 
the first line. This is formatted as:
"From idiot1 at netzero.net Fri Nov 9 00:30:27 2001"
(quotemarks mine, not found in data)
and I must crunch as needed to turn it into SECONDS SINCE THE EPOCH.

I then add a magic number to it (the number of seconds in 2 months), 
and compare it to NOW. If that sum is smaller than NOW, the message is 
VERY OLD, and we assume the account is abandoned, and delete it. We 
repeat this loop for every popbox in the directory, which contains 
nothing else BUT mailboxes, glob.glob('*.') to the rescue here.

This script is still in alpha stage, but I thought the list may find 
the process to do this crunching intresting.

I am unsure how to have a script run a su function. Sure,
os.system('rmuser'+filename)
comes to mind, but will FreeBSD accept such commands from a script 
running as a cronjob?

I will post the incomplete script on the tinylist site. Click THIS
http://www.tinylist.org/abandontest.txt
to view it.

Please keep in mind this script is untested as of yet and can use LOTS 
of work, and I welcome advice. As always, it is COPIOUSLY commented.

-- 


Respectfully,
              Kirk D Bailey, Pinellas county Florida USA

   think   http://www.tinylist.org/ - $FREE$ Liberating software
+-------+ http://www.pinellasintergroupsociety.org/ - NeoPagan
|  BOX  | http://www.listville.net/ - $FREE$ list hosting!
+-------+ http://www.howlermonkey.net/ - $FREE$ email Accounts
   kniht   http://www.sacredelectron.org/ - My personal site




More information about the Tutor mailing list