-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from fusionbox/develop
Allow whitelisting entire domains
- Loading branch information
Showing
4 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,14 @@ def test_send_multiple(self): | |
message = messages[1] | ||
self.assertEqual(message.get_all('to'), ['[email protected]', ]) | ||
|
||
def test_whitelist_domain(self): | ||
addresses = ['[email protected]', '[email protected]'] | ||
emails = [EmailMessage( 'Subject', 'Content', '[email protected]', addresses)] | ||
num_sent = self.get_connection().send_messages(emails) | ||
self.assertEqual(len(emails), num_sent) | ||
messages = self.get_mailbox_content() | ||
self.assertEqual(messages[0].get_all('to'), [', '.join(addresses)]) | ||
|
||
|
||
class LogOnlyBackendTestCase(BaseBackendTestCase): | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,8 @@ add those email addresses to | |
``BANDIT_WHITELIST``. ``BANDIT_WHITELIST`` defaults to an empty tuple:: | ||
|
||
BANDIT_WHITELIST = ('[email protected]', ) | ||
|
||
A domain can also be put in the BANDIT_WHITELIST. This will whitelist any email | ||
to that domain. | ||
|
||
BANDIT_WHITELIST = ('example.com', ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
SITE_ID=1, | ||
ADMINS=(('Admin', '[email protected]'), ), | ||
BANDIT_EMAIL='[email protected]', | ||
BANDIT_WHITELIST=('whitelisted.test.com', ), | ||
BASE_DIR='', # tells compatibility checker not to emit warning | ||
) | ||
|
||
|