diff --git a/WebRoot/js/zimbraAdmin/accounts/model/ZaAccount.js b/WebRoot/js/zimbraAdmin/accounts/model/ZaAccount.js index 7e0e4b4cb9..c688c074d0 100644 --- a/WebRoot/js/zimbraAdmin/accounts/model/ZaAccount.js +++ b/WebRoot/js/zimbraAdmin/accounts/model/ZaAccount.js @@ -2533,6 +2533,11 @@ ZaAccount.isEmailRetentionPolicyEnabled = function () { try { var instance = this.getInstance () ; var gc = ZaApp.getInstance().getGlobalConfig(); + if (AjxUtil.isEmpty(instance.attrs[ZaAccount.A_mailHost])) { + // GetEffectiveRightsRequest fails with an exception if a server name is blank + var ex = new ZmCsfeException("The request was not sent", ZmCsfeException.ACCT_INVALID_ATTR_VALUE, "GetEffectiveRightsRequest", "zimbraMailHost cannot be read"); + throw(ex); + } var sc = ZaApp.getInstance().getServerByName(instance.attrs[ZaAccount.A_mailHost]); var s_mailpurge = sc.attrs[ZaServer.A_zimbraMailPurgeSleepInterval] ; //always end with [s,m,h,d] var g_mailpurge = gc.attrs[ZaGlobalConfig.A_zimbraMailPurgeSleepInterval] ; @@ -2547,7 +2552,7 @@ ZaAccount.isEmailRetentionPolicyEnabled = function () { return true ; } catch (ex) { - return true; + return false; } } diff --git a/WebRoot/js/zimbraAdmin/accounts/view/ZaAccountXFormView.js b/WebRoot/js/zimbraAdmin/accounts/view/ZaAccountXFormView.js index 1dd8b91d68..356e7e7944 100644 --- a/WebRoot/js/zimbraAdmin/accounts/view/ZaAccountXFormView.js +++ b/WebRoot/js/zimbraAdmin/accounts/view/ZaAccountXFormView.js @@ -3467,7 +3467,8 @@ textFieldCssClass:"admin_xform_number_input"} ZaAccount.A_zimbraMailTrashLifetime, ZaAccount.A_zimbraMailSpamLifetime, ZaAccount.A_zimbraMailDumpsterLifetime - ]],[XForm.checkInstanceValueNot,ZaAccount.A_zimbraIsExternalVirtualAccount,"TRUE"]], + ]],[XForm.checkInstanceValueNot,ZaAccount.A_zimbraIsExternalVirtualAccount,"TRUE"], + [ZaAccount.isEmailRetentionPolicyEnabled]], label:ZaMsg.NAD_MailRetentionGrouper, id: "mailretention_settings", items: [ { type: _DWT_ALERT_,