Skip to content

Commit

Permalink
feat: add 127.0.0.1 to MailTrustedIP to prevent loss of OIP (#328)
Browse files Browse the repository at this point in the history
* feat: [CO-824] add 127.0.0.1 to MailTrustedIP to prevent loss of OIP.

* feat: [CO-824] add 127.0.0.1 to MailTrustedIP to prevent loss of OIP.

- generate code.

* feat: [CO-824] provide migration for MailTrustedIP

rif: [CO-824]
  • Loading branch information
keshavbhatt authored Sep 21, 2023
1 parent f8f6f2e commit 9a4fc82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions store/conf/attrs/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4744,6 +4744,7 @@ TODO - add support for multi-line values in globalConfigValue and defaultCOSValu
</attr>

<attr id="1025" name="zimbraMailTrustedIP" type="string" cardinality="multi" optionalIn="globalConfig,server" flags="serverInherited" requiresRestart="mailbox" since="5.0.17">
<globalConfigValue>127.0.0.1</globalConfigValue>
<desc>
In our web app, AJAX and standard html client, we have support for adding the HTTP
client IP address as X-Originating-IP in an outbound message. We also use
Expand Down
5 changes: 5 additions & 0 deletions store/ldap/src/updates/attrs/1694605275.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"zimbra_globalconfig": [
"zimbraMailTrustedIP"
]
}
2 changes: 1 addition & 1 deletion store/src/main/java/com/zimbra/cs/account/ZAttrConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32039,7 +32039,7 @@ public Map<String,Object> unsetMailSieveNotifyActionRFCCompliant(Map<String,Obje
*/
@ZAttr(id=1025)
public String[] getMailTrustedIP() {
return getMultiAttr(ZAttrProvisioning.A_zimbraMailTrustedIP, true, true);
String[] value = getMultiAttr(ZAttrProvisioning.A_zimbraMailTrustedIP, true, true); return value.length > 0 ? value : new String[] {"127.0.0.1"};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion store/src/main/java/com/zimbra/cs/account/ZAttrServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18487,7 +18487,7 @@ public Map<String,Object> unsetMailSSLProxyPort(Map<String,Object> attrs) {
*/
@ZAttr(id=1025)
public String[] getMailTrustedIP() {
return getMultiAttr(ZAttrProvisioning.A_zimbraMailTrustedIP, true, true);
String[] value = getMultiAttr(ZAttrProvisioning.A_zimbraMailTrustedIP, true, true); return value.length > 0 ? value : new String[] {"127.0.0.1"};
}

/**
Expand Down

0 comments on commit 9a4fc82

Please sign in to comment.