Change e-mail sending to use <Name> via Review Board when e-mail spoofing disabled.
Review Request #9216 — Created Sept. 24, 2017 and submitted
Information | |
---|---|
bleblan2 | |
Djblets | |
release-0.10.x | |
4578 | |
9209 | |
2179201... | |
Reviewers | |
djblets, students | |
When e-mail messages are created with
enabled_smart_spoofing
disabled,
the 'From' header should match a DMARC failure but instead the original
from_address
is used.This changes makes e-mail messages copy the same functionality as DMARC
not allowing spoofing whenenable_smart_spoofing
is disabled. This
changes the mail tests to expect the change in functionality when
enable_smart_spoofing
isFalse
.This change is from the comments on the review for adding an option for
disabling e-mail smart spoofing (https://reviews.reviewboard.org/r/9209).
The full testing suite for djblets was run.
Description | From | Last Updated |
---|---|---|
Please add the bug number in the bugs field. |
|
|
Can you run all of djblets tests? |
|
|
This needs unit tests for the new conditionals. Right now, I'm not 100% sure that this doesn't regress functionality. |
|
|
Format as: if (not enable_smart_spoofing or parsed_from_email != parsed_sender_email and not is_email_allowed_by_dmarc(parsed_from_email)): |
|
|
Use %-formatting: '"doc via example.com" <%s>' % settings.DEFAULT_FROM_EMAIL |
|
|
Same here re: formatting. |
|
|
The comments for all this logic no longer match the conditional, making it harder to understand the impact of the … |
|
-
-
-
djblets/mail/message.py (Diff revision 1) Format as:
if (not enable_smart_spoofing or parsed_from_email != parsed_sender_email and not is_email_allowed_by_dmarc(parsed_from_email)):
-
djblets/mail/tests.py (Diff revision 1) Use %-formatting:
'"doc via example.com" <%s>' % settings.DEFAULT_FROM_EMAIL
-

Change Summary:
Fix formatting issues brought up in review comments.
Testing Done: |
|
||||||
---|---|---|---|---|---|---|---|
Commit: |
|
||||||
Diff: |
Revision 2 (+13 -6) |
Checks run (2 succeeded)
-
-
This needs unit tests for the new conditionals. Right now, I'm not 100% sure that this doesn't regress functionality.
-
djblets/mail/message.py (Diff revision 2) The comments for all this logic no longer match the conditional, making it harder to understand the impact of the change in behavior.

Change Summary:
Fix comments to reflect changes to code.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+26 -16) |
Checks run (2 succeeded)

Change Summary:
Add test case for
enable_smart_spoofing=False
.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+59 -16) |