FCLT#54481 hMailserver automatisch opruimen

svn path=/Website/branches/v2018.1/; revision=39250
This commit is contained in:
Erik Groener
2018-10-02 12:11:51 +00:00
parent 1ab1c82162
commit f8c8a8f8b2

View File

@@ -6,6 +6,23 @@
// * delete all mails older then -daysToKeepMessages- from all mailboxes in all domains.
// *
// ******************************************
if (WScript.Arguments.length < 2)
{
WScript.Echo("Provide username and password. Number of days to keep is optional.");
WScript.Quit(-1);
}
var un = WScript.Arguments(0);
var pw = WScript.Arguments(1);
var days;
if (WScript.Arguments.length > 2)
days = WScript.Arguments(2);
MailboxCleaner(un, pw, days);
// ******************************************
function MailboxCleaner(hmAdminUsr, hmAdminPwd, daysToKeep)
{
var return_code = 0;
@@ -83,13 +100,6 @@ function padout(number)
function toDateTimeString(jsDate)
{
return padout(jsDate.getFullYear()) + "-" + padout(jsDate.getMonth() + 1) + "-" + padout(jsDate.getDate()) + " "
+ padout(jsDate.getHours()) + ":" + padout(jsDate.getMinutes()) + ":" + padout(jsDate.getSeconds())
+ padout(jsDate.getHours()) + ":" + padout(jsDate.getMinutes()) + ":" + padout(jsDate.getSeconds());
//+ " UTC"+(jsDate.getUTCHours()>0?"+":"")+padout(jsDate.getUTCHours()/10);
}
// Call script.
var un = "Administrator";
var pw = "VC43lk";
var days;
MailboxCleaner(un, pw, days);