Example #1
0
    def testJunkAfterAll(self):
        """Ignore any mechanisms after the all mechanism, but warn about it"""
        rec = "v=spf1 ip4:213.5.39.110 -all MS=83859DAEBD1978F9A7A67D3"
        domain = "avd.dk"

        parsed_record = checkdmarc_signalless.parse_spf_record(rec, domain)
        self.assertEqual(len(parsed_record["warnings"]), 1)
Example #2
0
    def testSplitSPFRecord(self):
        """Split SPF records are parsed properly"""

        rec = '"v=spf1 ip4:147.75.8.208 " "include:_spf.salesforce.com -all"'

        parsed_record = checkdmarc_signalless.parse_spf_record(rec, "example.com")

        self.assertEqual(parsed_record["parsed"]["all"], "fail")
Example #3
0
    def testUppercaseSPFMechanism(self):
        """Treat uppercase SPF"SPF mechanisms as valid"""
        spf_record = "v=spf1 IP4:147.75.8.208 -ALL"
        domain = "example.no"

        results = checkdmarc_signalless.parse_spf_record(spf_record, domain)

        self.assertEqual(len(results["warnings"]), 0)
Example #4
0
    def testSPFMissingARecord(self):
        """A warning is issued if a SPF record contains a mx mechanism
        pointing to a domain that has no A records"""

        spf_record = '"v=spf1 include:_spf.bibsyst.no a mx ~all"'
        domain = "sogne.folkebibl.no"
        results = checkdmarc_signalless.parse_spf_record(spf_record, domain)
        self.assertIn("sogne.folkebibl.no does not have any A/AAAA records",
                      results["warnings"])
Example #5
0
    def testSPFMissingMXRecord(self):
        """A warning is issued if a SPF record contains a mx mechanism
        pointing to a domain that has no MX records"""

        spf_record = '"v=spf1 mx ~all"'
        domain = "seanthegeek.net"
        results = checkdmarc_signalless.parse_spf_record(spf_record, domain)
        self.assertIn("{0} does not have any MX records".format(domain),
                      results["warnings"])