Skip to content

Commit

Permalink
feat: [CO-499] Remove both and mixed mode form web proxy config (#155)
Browse files Browse the repository at this point in the history
* chore: [CO-499] Remove both and mixed mode template expansion

- mixed and both mode templates are no longer required
see (CO-551)

* chore: set zimbraReverseProxyMailMode https as default mode & generate source
  • Loading branch information
keshavbhatt authored Feb 13, 2023
1 parent 8a9f564 commit c7efafc
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2230,10 +2230,7 @@ public static ReverseProxyLogLevel fromString(String s) throws ServiceException
}

public static enum ReverseProxyMailMode {
http("http"),
https("https"),
both("both"),
mixed("mixed"),
redirect("redirect");
private String mValue;
private ReverseProxyMailMode(String value) { mValue = value; }
Expand All @@ -2244,10 +2241,7 @@ public static ReverseProxyMailMode fromString(String s) throws ServiceException
}
throw ServiceException.INVALID_REQUEST("invalid value: "+s+", valid values: "+ Arrays.asList(values()), null);
}
public boolean isHttp() { return this == http;}
public boolean isHttps() { return this == https;}
public boolean isBoth() { return this == both;}
public boolean isMixed() { return this == mixed;}
public boolean isRedirect() { return this == redirect;}
}

Expand Down Expand Up @@ -15327,9 +15321,8 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
public static final String A_zimbraReverseProxyMailImapsEnabled = "zimbraReverseProxyMailImapsEnabled";

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* @since ZCS 5.0.7
*/
Expand Down
80 changes: 36 additions & 44 deletions store/src/main/java/com/zimbra/cs/account/ZAttrConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -46932,27 +46932,27 @@ public Map<String,Object> unsetMtaSmtpdProxyTimeout(Map<String,Object> attrs) {
*
* <p>Valid values: [yes, no]
*
* @return zimbraMtaSmtpdRejectUnlistedRecipient, or ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.no if unset and/or has invalid value
* @return zimbraMtaSmtpdRejectUnlistedRecipient, or ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.yes if unset and/or has invalid value
*
* @since ZCS 8.5.0
*/
@ZAttr(id=1534)
public ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient getMtaSmtpdRejectUnlistedRecipient() {
try { String v = getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedRecipient, true, true); return v == null ? ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.no : ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.fromString(v); } catch(com.zimbra.common.service.ServiceException e) { return ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.no; }
try { String v = getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedRecipient, true, true); return v == null ? ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.yes : ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.fromString(v); } catch(com.zimbra.common.service.ServiceException e) { return ZAttrProvisioning.MtaSmtpdRejectUnlistedRecipient.yes; }
}

/**
* Value for postconf smtpd_reject_unlisted_recipient
*
* <p>Valid values: [yes, no]
*
* @return zimbraMtaSmtpdRejectUnlistedRecipient, or "no" if unset
* @return zimbraMtaSmtpdRejectUnlistedRecipient, or "yes" if unset
*
* @since ZCS 8.5.0
*/
@ZAttr(id=1534)
public String getMtaSmtpdRejectUnlistedRecipientAsString() {
return getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedRecipient, "no", true);
return getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedRecipient, "yes", true);
}

/**
Expand Down Expand Up @@ -47063,27 +47063,27 @@ public Map<String,Object> unsetMtaSmtpdRejectUnlistedRecipient(Map<String,Object
*
* <p>Valid values: [yes, no]
*
* @return zimbraMtaSmtpdRejectUnlistedSender, or ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.no if unset and/or has invalid value
* @return zimbraMtaSmtpdRejectUnlistedSender, or ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.yes if unset and/or has invalid value
*
* @since ZCS 8.5.0
*/
@ZAttr(id=1535)
public ZAttrProvisioning.MtaSmtpdRejectUnlistedSender getMtaSmtpdRejectUnlistedSender() {
try { String v = getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedSender, true, true); return v == null ? ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.no : ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.fromString(v); } catch(com.zimbra.common.service.ServiceException e) { return ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.no; }
try { String v = getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedSender, true, true); return v == null ? ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.yes : ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.fromString(v); } catch(com.zimbra.common.service.ServiceException e) { return ZAttrProvisioning.MtaSmtpdRejectUnlistedSender.yes; }
}

/**
* Value for postconf smtpd_reject_unlisted_sender
*
* <p>Valid values: [yes, no]
*
* @return zimbraMtaSmtpdRejectUnlistedSender, or "no" if unset
* @return zimbraMtaSmtpdRejectUnlistedSender, or "yes" if unset
*
* @since ZCS 8.5.0
*/
@ZAttr(id=1535)
public String getMtaSmtpdRejectUnlistedSenderAsString() {
return getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedSender, "no", true);
return getAttr(Provisioning.A_zimbraMtaSmtpdRejectUnlistedSender, "yes", true);
}

/**
Expand Down Expand Up @@ -47574,13 +47574,13 @@ public Map<String,Object> unsetMtaSmtpdSaslTlsSecurityOptions(Map<String,Object>
/**
* Value for postconf smtpd_sender_login_maps
*
* @return zimbraMtaSmtpdSenderLoginMaps, or null if unset
* @return zimbraMtaSmtpdSenderLoginMaps, or "proxy:ldap:/opt/zextras/conf/ldap-slm.cf" if unset
*
* @since ZCS 8.5.0
*/
@ZAttr(id=1591)
public String getMtaSmtpdSenderLoginMaps() {
return getAttr(Provisioning.A_zimbraMtaSmtpdSenderLoginMaps, null, true);
return getAttr(Provisioning.A_zimbraMtaSmtpdSenderLoginMaps, "proxy:ldap:/opt/zextras/conf/ldap-slm.cf", true);
}

/**
Expand Down Expand Up @@ -47646,13 +47646,13 @@ public Map<String,Object> unsetMtaSmtpdSenderLoginMaps(Map<String,Object> attrs)
/**
* Value for postconf smtpd_sender_restrictions
*
* @return zimbraMtaSmtpdSenderRestrictions, or null if unset
* @return zimbraMtaSmtpdSenderRestrictions, or "reject_sender_login_mismatch" if unset
*
* @since ZCS 8.5.0
*/
@ZAttr(id=1590)
public String getMtaSmtpdSenderRestrictions() {
return getAttr(Provisioning.A_zimbraMtaSmtpdSenderRestrictions, null, true);
return getAttr(Provisioning.A_zimbraMtaSmtpdSenderRestrictions, "reject_sender_login_mismatch", true);
}

/**
Expand Down Expand Up @@ -60098,11 +60098,10 @@ public Map<String,Object> unsetReverseProxyMailImapsEnabled(Map<String,Object> a
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @return zimbraReverseProxyMailMode, or null if unset and/or has invalid value
*
Expand All @@ -60114,11 +60113,10 @@ public ZAttrProvisioning.ReverseProxyMailMode getReverseProxyMailMode() {
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @return zimbraReverseProxyMailMode, or null if unset
*
Expand All @@ -60130,11 +60128,10 @@ public String getReverseProxyMailModeAsString() {
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @param zimbraReverseProxyMailMode new value
* @throws com.zimbra.common.service.ServiceException if error during update
Expand All @@ -60149,11 +60146,10 @@ public void setReverseProxyMailMode(ZAttrProvisioning.ReverseProxyMailMode zimbr
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @param zimbraReverseProxyMailMode new value
* @param attrs existing map to populate, or null to create a new map
Expand All @@ -60169,11 +60165,10 @@ public Map<String,Object> setReverseProxyMailMode(ZAttrProvisioning.ReverseProxy
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @param zimbraReverseProxyMailMode new value
* @throws com.zimbra.common.service.ServiceException if error during update
Expand All @@ -60188,11 +60183,10 @@ public void setReverseProxyMailModeAsString(String zimbraReverseProxyMailMode) t
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @param zimbraReverseProxyMailMode new value
* @param attrs existing map to populate, or null to create a new map
Expand All @@ -60208,11 +60202,10 @@ public Map<String,Object> setReverseProxyMailModeAsString(String zimbraReversePr
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @throws com.zimbra.common.service.ServiceException if error during update
*
Expand All @@ -60226,11 +60219,10 @@ public void unsetReverseProxyMailMode() throws com.zimbra.common.service.Service
}

/**
* whether to run proxy in HTTP, HTTPS, both, mixed, or redirect mode.
* See also related attributes zimbraMailProxyPort and
* zimbraMailSSLProxyPort
* whether to run proxy in HTTPS or redirect mode. See also related
* attributes zimbraMailProxyPort and zimbraMailSSLProxyPort
*
* <p>Valid values: [http, https, both, mixed, redirect]
* <p>Valid values: [https, redirect]
*
* @param attrs existing map to populate, or null to create a new map
* @return populated map to pass into Provisioning.modifyAttrs
Expand Down
Loading

0 comments on commit c7efafc

Please sign in to comment.