Search in sources :

Example 41 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_14531 method doUpgrade.

@Override
void doUpgrade() throws ServiceException {
    Config config = prov.getConfig();
    String value = "zimbraSync:(&(|(displayName=*)(cn=*)(sn=*)(gn=*)(mail=*)(zimbraMailDeliveryAddress=*)(zimbraMailAlias=*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(zimbraHideInGal=TRUE))(!(zimbraIsSystemResource=TRUE)))";
    Map<String, Object> attr = new HashMap<String, Object>();
    attr.put("+" + Provisioning.A_zimbraGalLdapFilterDef, value);
    printer.println("Adding zimbraSync filter to global config " + Provisioning.A_zimbraGalLdapFilterDef);
    prov.modifyAttrs(config, attr);
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config)

Example 42 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_27075 method doGlobalConfig.

private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
    Config config = prov.getConfig();
    doEntry(zlc, config, "global config", AttributeClass.globalConfig);
    doBug79208(config);
    doBug83551(config);
}
Also used : Config(com.zimbra.cs.account.Config)

Example 43 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class RenameDomain method updateGlobalConfigSettings.

// TODO: should modify FlushCache to take more than one entry types, so that we
// can also flsuh the global config cache in the same request when we flush accounts.
private void updateGlobalConfigSettings(String curDefaultDomainName) {
    try {
        Config config = mProv.getConfig();
        HashMap<String, Object> attrMap = new HashMap<String, Object>();
        updateSystemAccount(config, Provisioning.A_zimbraNotebookAccount, attrMap);
        updateSystemAccount(config, Provisioning.A_zimbraSpamIsSpamAccount, attrMap);
        updateSystemAccount(config, Provisioning.A_zimbraSpamIsNotSpamAccount, attrMap);
        updateSystemAccount(config, Provisioning.A_zimbraAmavisQuarantineAccount, attrMap);
        String newDomainName = getNewDomain(curDefaultDomainName);
        if (curDefaultDomainName != null && newDomainName != null)
            attrMap.put(Provisioning.A_zimbraDefaultDomainName, newDomainName);
        mProv.modifyAttrs(config, attrMap);
        flushCacheOnAllServers(CacheEntryType.config);
    } catch (ServiceException e) {
        // just log it an continue
        warn("failed to update system accounts on global config", e);
    }
}
Also used : AccountServiceException(com.zimbra.cs.account.AccountServiceException) ServiceException(com.zimbra.common.service.ServiceException) HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config)

Example 44 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_33814 method doGlobalConfig.

private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
    Config config = prov.getConfig();
    doEntry(zlc, config, "global config", AttributeClass.globalConfig);
}
Also used : Config(com.zimbra.cs.account.Config)

Example 45 with Config

use of com.zimbra.cs.account.Config in project zm-mailbox by Zimbra.

the class BUG_43779 method doUpgrade.

@Override
void doUpgrade() throws ServiceException {
    Config config = prov.getConfig();
    String[] value = { "zimbraGroupAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(objectclass=zimbraDistributionList))", "zimbraGroupSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(objectclass=zimbraDistributionList))", "zimbraGroups:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(objectclass=zimbraDistributionList))" };
    Map<String, Object> attr = new HashMap<String, Object>();
    attr.put("+" + Provisioning.A_zimbraGalLdapFilterDef, value);
    printer.println("Adding zimbraGroupAutoComplete, zimbraGroupSync, and zimbraGroups filters to global config " + Provisioning.A_zimbraGalLdapFilterDef);
    prov.modifyAttrs(config, attr);
}
Also used : HashMap(java.util.HashMap) Config(com.zimbra.cs.account.Config)

Aggregations

Config (com.zimbra.cs.account.Config)73 HashMap (java.util.HashMap)24 Provisioning (com.zimbra.cs.account.Provisioning)10 Test (org.junit.Test)8 ServiceException (com.zimbra.common.service.ServiceException)7 Account (com.zimbra.cs.account.Account)7 RetentionPolicy (com.zimbra.soap.mail.type.RetentionPolicy)7 Element (com.zimbra.common.soap.Element)6 Policy (com.zimbra.soap.mail.type.Policy)6 Cos (com.zimbra.cs.account.Cos)5 Server (com.zimbra.cs.account.Server)5 Domain (com.zimbra.cs.account.Domain)4 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)4 Pair (com.zimbra.common.util.Pair)3 HashSet (java.util.HashSet)3 SMTPMessage (com.sun.mail.smtp.SMTPMessage)2 ZFilterAction (com.zimbra.client.ZFilterAction)2 ZFileIntoAction (com.zimbra.client.ZFilterAction.ZFileIntoAction)2 ZFilterCondition (com.zimbra.client.ZFilterCondition)2 ZHeaderCondition (com.zimbra.client.ZFilterCondition.ZHeaderCondition)2