Review Board tries to send e-mails on behalf of users by spoofing their
e-mail address, in order to offer better comment threads. While it tries
to be smart about when to do this (by checking DNS records to see whether
it can safely spoof the e-mail address), it's sometimes ideal to simply
turn off this behavior and send from the server's configured e-mail
address instead.

This change adds an option to force the server's e-mail address to be
used for all e-mails. When enabled, e-mails will still appear to come
from the user, but only by name (using "<Name> via Review Boardserver@email" as the From address).

In order for this change to correctly send e-mails using the "<Name> via
Review Board server@email" format, the mail message in djblets must be
updated to send e-mails using that format when email_smart_spoofing is
set to False.

Testing Done

The notifications tests were updated to check that the email used issettings.DEFAULT_FROM_EMAIL instead of settings.SERVER_EMAIL. Thereviewboard.notifications.tests suite was run. Tests added for new
review emails and review reply emails with enable_smart_spoofing
disabled.

Screenshots

Files

Loading file attachments...

Issues

0

0

11

0

All Issues:11

Description

From

Last Updated

Not sure whether we should be switching the default to SERVER_EMAIL in this change. That will have an impact on ...

Checks run (2 succeeded)

Not sure whether we should be switching the default to SERVER_EMAIL in this change. That will have an impact on existing Review Board installs. Best to keep this change solely focused on the new option instead. In general, you want your changes to be heavily focused and not do "Also fixed ..." work (this isn't a black-and-white rule, but is a good goal).

Review Board tries to send e-mails on behalf of users by spoofing their e-mail
address, in order to offer better comment threads. While it tries to be smart
about when to do this (by checking DNS records to see whether it can safely
spoof the e-mail address), it's sometimes ideal to simply turn off this behavior
and send from the server's configured e-mail address instead.
This change adds an option to force the server's e-mail address to be used for
all e-mails. When enabled, e-mails will still appear to come from the user, but
only by name (using "<Name> via Review Board <server@email>" as the From address).

I'd suggest reversing this option and making it about sending on behalf of users, enabled by default. So something like mail_enable_smart_spoofing (to keep consistent with internal terminology and changing the label/help text accordingly.

Right now, we actually have something in setting.py for this, which is EMAIL_ENABLE_SMART_SPOOFING. Some companies are going to have this turn on/off, so we should back the siteconfig value from this setting and sync both ways (look in the settings_map variable in admin/siteconfig.py).

Change Summary:

Update to address comments on review.

Description:

~

Emails get sent with the user's email address in the 'From' header. This can get those emails caught as spam. With the new option, the 'From' header is set to match the configured 'Sender e-mail address'.

~

Review Board tries to send e-mails on behalf of users by spoofing their

+

e-mail address, in order to offer better comment threads. While it tries

+

to be smart about when to do this (by checking DNS records to see whether

+

it can safely spoof the e-mail address), it's sometimes ideal to simply

+

turn off this behavior and send from the server's configured e-mail

+

address instead.

~

The 'From' address used is also changed to be the settings.DEFAULT_FROM_EMAIL setting instead of the settings.SERVER_EMAIL setting which is inherited from django (root@localhost).