~mailman-coders/mailman/2.1

« back to all changes in this revision

Viewing changes to Mailman/Utils.py

  • Committer: Mark Sapiro
  • Date: 2020-05-28 20:27:34 UTC
  • Revision ID: mark@msapiro.net-20200528202734-dpskelj4k8bsiteq
DMARC mitigation no longer misses upper case names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1343
1343
        cnames = {}
1344
1344
        want_names = set([dmarc_domain + '.'])
1345
1345
        for txt_rec in txt_recs.response.answer:
 
1346
            # Don't be fooled by an answer with uppercase in the name.
 
1347
            name = txt_rec.name.to_text().lower()
1346
1348
            if txt_rec.rdtype == dns.rdatatype.CNAME:
1347
 
                cnames[txt_rec.name.to_text()] = (
 
1349
                cnames[name] = (
1348
1350
                    txt_rec.items[0].target.to_text())
1349
1351
            if txt_rec.rdtype != dns.rdatatype.TXT:
1350
1352
                continue
1351
 
            results_by_name.setdefault(txt_rec.name.to_text(), []).append(
 
1353
            results_by_name.setdefault(name, []).append(
1352
1354
                "".join(txt_rec.items[0].strings))
1353
1355
        expands = list(want_names)
1354
1356
        seen = set(expands)