Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cecylia Bocovich
gettor
Commits
ae30ca5e
Commit
ae30ca5e
authored
Jan 23, 2021
by
hanneloresx
Committed by
Cecylia Bocovich
Jan 25, 2021
Browse files
Redact email addr from error msgs
Addresses issue #34058 to scrub logs of personal info.
parent
dd2818ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
gettor/services/email/sendmail.py
View file @
ae30ca5e
...
...
@@ -235,7 +235,11 @@ class Sendmail(object):
yield
self
.
conn
.
remove_request
(
id
=
id
,
service
=
"email"
,
date
=
date
)
log
.
error
(
"Error sending email: {}."
.
format
(
e
))
log
.
error
(
strings
.
redact_emails
(
"Error sending email:{}."
.
format
(
e
))
)
except
Exception
as
e
:
log
.
error
(
"Error sending email: {}."
.
format
(
e
))
log
.
error
(
strings
.
redact_emails
(
"Error sending email:{}."
.
format
(
e
))
)
gettor/utils/strings.py
View file @
ae30ca5e
...
...
@@ -13,6 +13,7 @@ the Tor Browser.
import
json
import
os
import
inspect
import
re
strings
=
{}
translations
=
{}
...
...
@@ -115,6 +116,10 @@ def load_strings(current_locale):
strings
[
s
]
=
translations
[
current_locale
][
s
]
def
redact_emails
(
text
):
redacted_text
=
re
.
sub
(
r
'[\w\.+-]+@[\w\.+-]+'
,
'[REDACTED_EMAIL]'
,
text
)
return
redacted_text
def
translated
(
k
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment