mirror of
https://github.com/pretix/pretix.git
synced 2026-08-10 10:47:00 +00:00
Mail settings: Add support for SPF redirect mechanism
This commit is contained in:
@@ -73,6 +73,11 @@ def _check_spf_record(not_found_lookup_parts, spf_record, depth):
|
||||
rec_record = get_spf_record(hostname)
|
||||
if rec_record:
|
||||
_check_spf_record(not_found_lookup_parts, rec_record, depth + 1)
|
||||
elif p.startswith('redirect='):
|
||||
_, hostname = p.split('=')
|
||||
rec_record = get_spf_record(hostname)
|
||||
if rec_record:
|
||||
_check_spf_record(not_found_lookup_parts, rec_record, depth + 1)
|
||||
|
||||
|
||||
def check_spf_record(lookup, spf_record):
|
||||
|
||||
@@ -587,7 +587,8 @@ class EventsTest(SoupTest):
|
||||
@staticmethod
|
||||
def _fake_spf_record(hostname):
|
||||
return {
|
||||
'test.pretix.dev': 'v=spf1 a mx include:level2.pretix.dev ~all',
|
||||
'test.pretix.dev': 'v=spf1 redirect=_spf.pretix.dev',
|
||||
'_spf.pretix.dev': 'v=spf1 a mx include:level2.pretix.dev ~all',
|
||||
'level2.pretix.dev': 'v=spf1 a mx +include:level3.pretix.dev include:spftest.pretix.dev '
|
||||
'-include:level4.pretix.dev ~all',
|
||||
'level3.pretix.dev': 'v=spf1 a mx include:test2.pretix.dev ~all',
|
||||
|
||||
Reference in New Issue
Block a user