chapps.tests.test_policy.test_spf_policy module
Tests for CHAPPS SPF Enforcement policy module
- class chapps.tests.test_policy.test_spf_policy.Test_PostfixSPFActions[source]
Bases:
object
Tests for Postfix action strings corresponding to particular SPF results
The possible results are:
pass*
fail*
softfail
temperror*
permerror*
none/neutral (two which must be treated the same)
Starred items are ones for which RFC 7208 provides recommended SMTP result codes. For now, configuration will be able to override how the non-starred results are mapped onto actions taken for other classes of message. Eventually a response which implements greylisting (say, for softfails) will be provided, which could be applied also to none/neutral situations as well.
- class chapps.tests.test_policy.test_spf_policy.Test_SPFEnforcementPolicy[source]
Bases:
object
Tests of the SPF module
- test_passing_emails_get_prepend(caplog, monkeypatch, passing_spf_query, testing_policy_spf, allowable_inbound_ppr, populated_database_fixture)[source]
- test_whitelisted_clients_get_dunno(caplog, monkeypatch, helo_ppr_factory, testing_policy_spf, populated_database_fixture)[source]
- GIVEN
a HELO whitelist
- WHEN
email arrives from a whitelisted server
- THEN
forward the email with DUNNO (no prepends)
- test_domain_spf_flag_false(caplog, monkeypatch, passing_spf_query, testing_policy_spf, allowable_inbound_ppr, populated_database_fixture_with_extras)[source]
- GIVEN
the domain has the SPF-checking flag set to false
- WHEN
policy approval is requested
- THEN
PREPEND the SPF result header and forward the email
- test_failing_emails_get_reject(caplog, monkeypatch, failing_spf_query, testing_policy_spf, allowable_inbound_ppr, populated_database_fixture)[source]
- test_no_helo_passing_mf_gets_prepend(caplog, monkeypatch, no_helo_passing_mf, testing_policy_spf, allowable_inbound_ppr, populated_database_fixture)[source]