Just my 2 cents - why you try to modify the webadmin code and on top in language you don't know while you can create standalone script in your preferred programming language?
General idea of the script:
- get list of all physical mailbox folders in the filesystem,
- for each physical mailbox, check if there is corresponding entry in mailbox table (attributes storagebasedirectory, storagenode, mailbox)
- delete/move away the not existing onesRun this script as often as suits best your application.
I'm trying to avoid this method due to its Inefficiency. Why query a massive directory structure containing non uniform directory paths to specific user accounts just to again loop that through a query against the database... when you can execute, at the time of deletion, a single query that finds the exact path of the deleted mailbox user and stores it them deletes it at a later date.
1 query vs multiple 'find -type d' statements for each unique directory structure(of which are sever) over several million directories which then must be further processed to determine if the the directory is a user account or a domain, or some random number/letter.
It's just very inefficient and requires a good amount of post processing, but non the less a very valid point, one which I will fall back to should I not be able to get my python in check before deployment. The input is very much appreciated.
Thank you very much.