New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] override_mail_recipients. Allow whitelisted domain. #104
Conversation
if I understand correctly, filling in But with a slight change I think this will be a great addition here: Can't we introduce another config parameter for the whitelisting which is a comma separated list of domains, and those won't be touched by the override? This way, they can test internal mails just fine, and external mails go to odoomailtest@customer or whatever is filled into the override parameter? Seems even like added value to me. |
PS: No idea what's going on with travis |
You understood correctly. I will go the extra mile and do it this way. |
for what it's worth, I updated our fork of MTQ and now we're happily green |
2449689
to
6d7986c
Compare
Codecov Report
@@ Coverage Diff @@
## 11.0 #104 +/- ##
===========================================
+ Coverage 80.55% 91.42% +10.87%
===========================================
Files 2 2
Lines 36 70 +34
===========================================
+ Hits 29 64 +35
+ Misses 7 6 -1
Continue to review full report at Codecov.
|
216fbae
to
3b4d606
Compare
3b4d606
to
8b20aad
Compare
extract_rfc2822_addresses(override) \ | ||
if override != 'disable' else [] | ||
assert override_recipients or whitelisted_domains, \ | ||
'No valid override_email_to' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add bf6b463 or something similar to make this not fail on new installations
This was done for a customer that still wanted to test emails send to their own addresses, but still making certain no other of their partners receive emails.
Apart from the new domain whitelist functionality, I moved the send_email to the top of the code, according to the principle that main functions should be above helper functions.
(Editted after following up on the suggestions of @hbrunn ).