Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Junk E-Mail and Deleted Items Cleaner
  •  
iwarner

Messages: 21

Karma: 0
Send a private message to this user
KerioCleaner

I wrote a batch script some time ago to clean up Junk and Deleted Items for all my users accounts - it also has some nice features to restart, start or stop the KerioMail server also.

>>Please Donate Here<<

Requirements
Will only work on Windows
Tested on XP and 2003

Process
Users should always stop the Kerio Mailserver Service before doing anything to the store.
It basically goes through each domain then each user account renames the index.fld to index.bad and removes all the msgs.

Roadmap
Now I need some feedback on whether people want to backup these messages, or log any items along the way. As I use it for personal use I kind of know what to expect. So any feedback on a tool like this is appreciated I can then add to my script and release.

The script currently offers the following options

A. Restart Kerio
B. Shutdown Kerio
C. Start Kerio
D. Clean Up [Junk Email] Folders
E. Clean Up [Deleted Items] Folders
Q. Quit

Please feedback on any other needed options

Also I need to know if people change the install path? Or whether they change the service name during installation?

The script will be offered as OpenSource but donations are always accepted :)

>>Please Donate Here<<

Attached is the batch file, I have tested and used this on my server for some time, so it does work but please I take no responsibility for any issues you may encounter on your environment, use this at your own risk.

TODO
1. Currently hardcoded to use - kerioPath=C:\Program Files\Kerio\MailServer\store\mail\ - make this dynamic
2. Date settings does not work yet - it will simply delete all MSGs at the moment, I will work on this, but need feedback on best practice - I am working on "keep n weeks" and delete the rest.
3. Provide an external log of the actions taken if needs be.
4. For Junk mail and Deleted Items should we delete the search.fld sort.fld delete.fld also?
5. Automatically STOP the service if it is still running when the user tries to delete msgs actions.

>>Please Donate Here<<

[Updated on: Sat, 09 December 2006 06:06]

  •  
Kerio_ktrumbull

Messages: 597
Karma: 2
Send a private message to this user
I have to say that I am not in favor of this script. Any script that auto-deletes mail always spells trouble for us (tech support). I am also not in favor of any script that does anything to the store directory structure while the MailServer is running.

This script is not supported or condoned by Kerio Technologies, Inc. This script will break the following features of Kerio MailServer: Entourage Synchronization, Quotas, Backups, and ActiveSync Synchronization.

[Updated on: Fri, 08 December 2006 23:53]


Kevin Trumbull
Kerio Technical Support Team Leader
http://support.kerio.com
  •  
Pavel Dobry (Kerio)

Messages: 5245
Karma: 251
Send a private message to this user
I have to agree with ktrumbull.

Running this script will cause inconsistency in the message store.

You really should NOT do it.
  •  
iwarner

Messages: 21

Karma: 0
Send a private message to this user
Then please "Kerio" give us something that will work then!

I have so much Junk coming through on all the accounts I support that running the backup takes too long and it also is creating a disk space issues if I keep several in reserve.

The script allows the user to stop the server also.

Please tell me how it effects the following:

"This script will break the following features of Kerio MailServer: Entourage Synchronization, Quotas, Backups, and ActiveSync Synchronization."

And we can look at ways to stop it breaking these. Especially how can it break Backups?

I have seen in many instances on this forum the process I use described, and not once have you replied in such a manner. I have also been using this for some time now with no issues.

Again though I repeat to all users - use at your own risk.

[Updated on: Sat, 09 December 2006 05:36]

  •  
winkelman

Messages: 2119
Karma: 3
Send a private message to this user
iwarner wrote on Sat, 09 December 2006 05:35


"This script will break the following features of Kerio MailServer: Entourage Synchronization, Quotas, Backups, and ActiveSync Synchronization."

And we can look at ways to stop it breaking these. Especially how can it break Backups?


It can break backups if you schedule your script while the backup is about to, or actually running. That's not a very big deal IMHO, as you just have to make sure your script and the backup do not coincide.

It will in all likelihood break the quota's. Though this is as much Kerio's problem then yours. A lot of things corrupt the quota's (such as deleting a user and asking it's mail to be transferred to another user) and I find it necessary to recount quota's here every month or so, just to make them right again. This can be done by deleting the 'stats' file from the users mail folder. They will be recreated when needed. To force this, just go to the Users tab in Admin Console (this may take a fair amount of time if your store is substantial).

Still, I have to agree with Kerio that it is risky to mess with the store, and these kind of scripts make messing with the store a regular thing. This also means that Kerio needs to address these wishes themselves, as they are obviously much wanted.
  •  
iwarner

Messages: 21

Karma: 0
Send a private message to this user
The user can stop the mailserver - I have now made it so the script stops this anyway before doing the cleaning - so no collision can happen now, am testing and will upload soon.

Why don't I make the script delete the stats file also in these folders, if they are recreated.?

I already asked if these should also be deleted:

"For Junk mail and Deleted Items should we delete the search.fld sort.fld delete.fld also?"

They are all recreated it seems upon user actions.

I am still unsure of what else can break and why as Kerio don't seem to offer guidance just warnings, but on the flip side I can't be having all the junk and deleted rubbish in my user accounts for too long, it just adds more hassle.
  •  
mosegaard

Messages: 5
Karma: 0
Send a private message to this user
Kerio Support!

This issue is not grayed out - yet!

If you dont this this "feature" is that good... why dont you guys "handout" alternatives? Is this placed in the category "suggestions" as well? ;-)

/hans
  •  
Lyle M

Messages: 410

Karma: 7
Send a private message to this user
If anyone feels that definable and automated mailbox maintenance is a useful feature, just submit your requests through the ticket system as described here:

http://forums.kerio.com/index.php?t=msg&th=8390&star t=0&S=426f24c0420363b78a27c8069760a4eb

The more of us that request it through the correct channel, the more likely it will get development priority. I find it's most useful to not only request a feature, but offer thoughts as to why it is valuable. It's also a good idea to detail aspects of the implementation. Just saying, "I want a purge feature for junk and deleted items folders," falls a bit short.

Think a feature request all the way through. Do we want this to be user definable? If so, are their admin imposed limitations by domain? Globally? Should this purge option be configurable for all folders, or just junk and trash? Do we want users to be able to set delete variables beyond just date ranges? How about skipping high-priority and flagged messages? The more detail we provide in our requests, the more robust the feature may become.

That being said, I think I'll go submit my feature request and practice what I preach!

Thanks for contributing to the KMS admin community iwarner.

Happy New Year Everyone.

-Lyle Millander
  •  
iwarner

Messages: 21

Karma: 0
Send a private message to this user
It would still be good to know the answers to some of the WHYS within this thread.

1. Why will the script cause inconsistencies in the message store, can we have a technical answer to this please.

"This script will break the following features of Kerio MailServer: Entourage Synchronization, Quotas, Backups, and ActiveSync Synchronization. "

2. Why will it break these elements?

If Kerio can not give concise answers to some of these questions then I have to feel that the general code of the application is lacking if simple maintenance can not be done on the filesystem of the server the application is installed on.

If we can get some whys then scripts like mine, and I am sure other users can be made to compliment Kerio.

Its about time that Kerio opened up a little and got into the next millenium and allowed developers to create modules for Kerio. If this means Kerio need to release an API then I think this should be a priority. It will further the application no end. Please take a leaf out of Mozilla's book and let the users start helping themselves.

Regards

Ian Warner
Previous Topic: Global view in calendar
Next Topic: Cannot migrate from 4D Mail to KMS?
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Wed Nov 22 02:38:10 CET 2017

Total time taken to generate the page: 0.00426 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.