Skip to content

Commit

Permalink
ZCS-12471- adding LDAP attribute for mail recall
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamCS03 committed May 9, 2023
1 parent 0701d85 commit 29db4e7
Show file tree
Hide file tree
Showing 6 changed files with 623 additions and 0 deletions.
17 changes: 17 additions & 0 deletions common/src/java/com/zimbra/common/account/ZAttrProvisioning.java
Original file line number Diff line number Diff line change
Expand Up @@ -7140,6 +7140,23 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
@ZAttr(id=566)
public static final String A_zimbraFeatureMailPriorityEnabled = "zimbraFeatureMailPriorityEnabled";

/**
* Enables the mail recall functionality
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public static final String A_zimbraFeatureMailRecallEnabled = "zimbraFeatureMailRecallEnabled";

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public static final String A_zimbraFeatureMailRecallTime = "zimbraFeatureMailRecallTime";

/**
* whether the send later feature is enabled
*
Expand Down
10 changes: 10 additions & 0 deletions store/conf/attrs/zimbra-attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10319,6 +10319,16 @@ TODO: delete them permanently from here
<attr id="4093" name="zimbraTrialConvertAtExpiration" type="boolean" cardinality="single" optionalIn="account,cos,domain" flags="accountCosDomainInherited,accountInfo" since="9.0.0">
<desc>Can be used by an external service to indicate that a trial is set to convert to active at expiration.</desc>
</attr>
<attr id="4094" name="zimbraFeatureMailRecallEnabled" type="boolean" cardinality="single" optionalIn="globalConfig,account,cos,domain" flags="domainInfo,accountInfo,domainInherited,accountCosDomainInherited" since="10.1.0">
<globalConfigValue>FALSE</globalConfigValue>
<defaultCOSValue>FALSE</defaultCOSValue>
<desc>Enables the mail recall functionality</desc>
</attr>
<attr id="4095" name="zimbraFeatureMailRecallTime" type="integer" min="1" max="30" cardinality="single" optionalIn="globalConfig,account,cos,domain" flags="domainInfo,accountInfo,domainInherited,accountCosDomainInherited" since="10.1.0">
<globalConfigValue>30</globalConfigValue>
<defaultCOSValue>30</defaultCOSValue>
<desc>Time(in minutes) within which a message can be recalled. The default time is 30 minutes and accepts value from 1 to 30.</desc>
</attr>

<attr id="9001" name="zimbraMailSieveScriptMaxSize" type="long" min="0" cardinality="single" optionalIn="globalConfig,account,cos,domain" flags="domainInfo,accountInfo,accountCosDomainInherited" since="11.0.0">
<globalConfigValue>0</globalConfigValue>
Expand Down
149 changes: 149 additions & 0 deletions store/src/java/com/zimbra/cs/account/ZAttrAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -17849,6 +17849,155 @@ public Map<String,Object> unsetFeatureMailPriorityEnabled(Map<String,Object> att
return attrs;
}

/**
* Enables the mail recall functionality
*
* @return zimbraFeatureMailRecallEnabled, or false if unset
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public boolean isFeatureMailRecallEnabled() {
return getBooleanAttr(Provisioning.A_zimbraFeatureMailRecallEnabled, false, true);
}

/**
* Enables the mail recall functionality
*
* @param zimbraFeatureMailRecallEnabled new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public void setFeatureMailRecallEnabled(boolean zimbraFeatureMailRecallEnabled) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, zimbraFeatureMailRecallEnabled ? TRUE : FALSE);
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Enables the mail recall functionality
*
* @param zimbraFeatureMailRecallEnabled new value
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public Map<String,Object> setFeatureMailRecallEnabled(boolean zimbraFeatureMailRecallEnabled, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, zimbraFeatureMailRecallEnabled ? TRUE : FALSE);
return attrs;
}

/**
* Enables the mail recall functionality
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public void unsetFeatureMailRecallEnabled() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, "");
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Enables the mail recall functionality
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public Map<String,Object> unsetFeatureMailRecallEnabled(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, "");
return attrs;
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @return zimbraFeatureMailRecallTime, or 30 if unset
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public int getFeatureMailRecallTime() {
return getIntAttr(Provisioning.A_zimbraFeatureMailRecallTime, 30, true);
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @param zimbraFeatureMailRecallTime new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public void setFeatureMailRecallTime(int zimbraFeatureMailRecallTime) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, Integer.toString(zimbraFeatureMailRecallTime));
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @param zimbraFeatureMailRecallTime new value
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public Map<String,Object> setFeatureMailRecallTime(int zimbraFeatureMailRecallTime, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, Integer.toString(zimbraFeatureMailRecallTime));
return attrs;
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public void unsetFeatureMailRecallTime() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, "");
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public Map<String,Object> unsetFeatureMailRecallTime(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, "");
return attrs;
}

/**
* whether the send later feature is enabled
*
Expand Down
149 changes: 149 additions & 0 deletions store/src/java/com/zimbra/cs/account/ZAttrConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18597,6 +18597,155 @@ public Map<String,Object> unsetFeatureDistributionListFolderEnabled(Map<String,O
return attrs;
}

/**
* Enables the mail recall functionality
*
* @return zimbraFeatureMailRecallEnabled, or false if unset
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public boolean isFeatureMailRecallEnabled() {
return getBooleanAttr(Provisioning.A_zimbraFeatureMailRecallEnabled, false, true);
}

/**
* Enables the mail recall functionality
*
* @param zimbraFeatureMailRecallEnabled new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public void setFeatureMailRecallEnabled(boolean zimbraFeatureMailRecallEnabled) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, zimbraFeatureMailRecallEnabled ? TRUE : FALSE);
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Enables the mail recall functionality
*
* @param zimbraFeatureMailRecallEnabled new value
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public Map<String,Object> setFeatureMailRecallEnabled(boolean zimbraFeatureMailRecallEnabled, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, zimbraFeatureMailRecallEnabled ? TRUE : FALSE);
return attrs;
}

/**
* Enables the mail recall functionality
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public void unsetFeatureMailRecallEnabled() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, "");
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Enables the mail recall functionality
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4094)
public Map<String,Object> unsetFeatureMailRecallEnabled(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallEnabled, "");
return attrs;
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @return zimbraFeatureMailRecallTime, or 30 if unset
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public int getFeatureMailRecallTime() {
return getIntAttr(Provisioning.A_zimbraFeatureMailRecallTime, 30, true);
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @param zimbraFeatureMailRecallTime new value
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public void setFeatureMailRecallTime(int zimbraFeatureMailRecallTime) throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, Integer.toString(zimbraFeatureMailRecallTime));
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @param zimbraFeatureMailRecallTime new value
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public Map<String,Object> setFeatureMailRecallTime(int zimbraFeatureMailRecallTime, Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, Integer.toString(zimbraFeatureMailRecallTime));
return attrs;
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public void unsetFeatureMailRecallTime() throws com.zimbra.common.service.ServiceException {
HashMap<String,Object> attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, "");
getProvisioning().modifyAttrs(this, attrs);
}

/**
* Time(in minutes) within which a message can be recalled. The default
* time is 30 minutes and accepts value from 1 to 30.
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
*
* @since ZCS 10.1.0
*/
@ZAttr(id=4095)
public Map<String,Object> unsetFeatureMailRecallTime(Map<String,Object> attrs) {
if (attrs == null) attrs = new HashMap<String,Object>();
attrs.put(Provisioning.A_zimbraFeatureMailRecallTime, "");
return attrs;
}

/**
* Maximum size in bytes for file uploads.
*
Expand Down
Loading

0 comments on commit 29db4e7

Please sign in to comment.