ZCS-11699: adding check to verify zimbra_external_email_warning is enabled before updating the content #1317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solution
ZCS-11699 is about improving the performance of a new functionality introduced with ZCS-11096, which is in charge of prepending a "warning" text to the message when it comes from outside of the organization for which the receiving account belongs. With such feature, some parsing routines where introduced and executed even when the feature was disabled, thus causing unnecessary workload in the scenario of having the feature disabled.
For this fix we have added additional logic on the
ZimbraLmtpBackend
class in order to make sure that the relevant message parsing routines get executed only if necessary (i.e. when the warning feature is enabled).Notes
Please consider that there will be extra workload when the feature is actually enabled, but this is an expected trade-off from getting to parse every incoming message for the purpose of prepending the warning message accordingly.
Testing
Please check ticket for details.