This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 50f8722 rework anonymizing logic
50f8722 is described below
commit 50f8722d560586730c476a1a10d562c7032cbbba
Author: Daniel Gruno <[email protected]>
AuthorDate: Wed Oct 27 00:52:16 2021 +0200
rework anonymizing logic
---
server/plugins/messages.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index bab3afa..ca0ea03 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -103,10 +103,10 @@ def anonymize(doc):
ptr["from"] = re.sub(
r"<(\S{1,2})\S*@([-a-zA-Z0-9_.]+)>", "<\\1...@\\2>",
ptr["from"]
)
- if ptr["body"]:
- ptr["body"] = re.sub(
- r"<(\S{1,2})\S*@([-a-zA-Z0-9_.]+)>", "<\\1...@\\2>",
ptr["body"]
- )
+ if "body" in ptr and ptr["body"]:
+ ptr["body"] = re.sub(
+ r"<(\S{1,2})\S*@([-a-zA-Z0-9_.]+)>", "<\\1...@\\2>", ptr["body"]
+ )
return doc