Page 1 of 1

DataDirectorySynchronizer for individual account

Posted: 2008-04-21 00:33
by gsmaclean
Needing to run DataDirectorySynchronizer on an individual account (not on every account on the system), I wrote the attached script to do so. Martin started off with a small script to do adds only, and I added to it to give it add/delete functionality and error checking.

The code is not the cleanest around, but I needed it fast - it does work.

Just run it, enter your admin password and the email address you want to synchronize, and it will do the rest.

First, it scans through the database. If it finds any messages in the database for that account that don't have corresponding .eml files on disk, it deletes the message from the database.

Second, it scans through the .eml files on disk. If it finds any .eml files that don't have corresponding entries in the database, it adds them to the database.

It's not the fastest thing in the world, but it does work - I tested it several times on my test installation, and then I went ahead and used it on the user account I had to restore on my production box - and it worked perfectly.

One thing I did notice is that hMailServer does not know about the added/deleted messages until the hMailServer service is stopped and restarted - even if the database performance caching is disabled. I added a warning message to this effect.

Re: DataDirectorySynchronizer for individual account

Posted: 2008-05-31 07:37
by tayyem
Hi

I have tried to download the attachment but forbidden message appears, please check the links and permissions.

Thanks

Re: DataDirectorySynchronizer for individual account

Posted: 2008-05-31 11:06
by ^DooM^
tayyem wrote:Hi

I have tried to download the attachment but forbidden message appears, please check the links and permissions.

Thanks
Works fine for me.

Re: DataDirectorySynchronizer for individual account

Posted: 2008-05-31 15:36
by gsmaclean
tayyem wrote:Hi

I have tried to download the attachment but forbidden message appears, please check the links and permissions.

Thanks
Works for me as well, perhaps you have a virus checker or something blocking it?