[Mailman-Users] Manually treat certain domains as if they have restrictive DMARC policy

David Gibbs david at midrange.com
Tue Jan 29 09:55:07 EST 2019


On 1/29/2019 12:13 AM, Mark Sapiro wrote:
> Also, Adding a global setting for dmarc_moderation_addresses on top of
> the per-list setting is not difficult either. See
> <https://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1574>
> for how this was done for a global ban_list.

I'm by no means a Python expert (far from it), but I hacked this together...

=== modified file 'Mailman/Defaults.py.in'
--- Mailman/Defaults.py.in      2018-07-12 03:14:02 +0000
+++ Mailman/Defaults.py.in      2019-01-29 14:27:59 +0000
@@ -145,6 +145,11 @@
  # GLOBAL_BAN_LIST = ['xxx at aol\.com', '^yyy.*@gmail\.com$']
  GLOBAL_BAN_LIST = []

+# Installation wide DMARC list.  This is a list of email addresses and
+# regexp patterns (beginning with ^) that will be treated as if they
+# have a restrictive DMARC policy. Same examples as GLOBAL_BAN_LIST
+GLOBAL_DMARC_LIST = []
+
  # If the following is set to Yes, and a web subscribe comes from an IPv4
  # address and the IP is listed in Spamhaus SBL, CSS or XBL, the subscription
  # will be blocked.  It will work with IPv6 addresses if Python's py2-ipaddress

=== modified file 'Mailman/Handlers/SpamDetect.py'
--- Mailman/Handlers/SpamDetect.py      2018-12-01 04:13:12 +0000
+++ Mailman/Handlers/SpamDetect.py      2019-01-29 14:24:26 +0000
@@ -110,6 +110,7 @@
          dn, addr = parseaddr(msg.get('from'))
          if addr and mlist.dmarc_moderation_action > 0:
              if (mlist.GetPattern(addr, mlist.dmarc_moderation_addresses) or
+                mlist.getPattern(addr, mm_cfg.GLOBAL_DMARC_LIST) or
                  Utils.IsDMARCProhibited(mlist, addr)):
                  # Note that for dmarc_moderation_action, 0 = Accept,
                  #    1 = Munge, 2 = Wrap, 3 = Reject, 4 = Discard





-- 
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding 615 miles (Yes, you read that right) in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness.  You can make a tax-deductible donation to my ride by visiting https://gmane.diabetessucks.net.

You can see where my donations come from by visiting my interactive donation map ... https://gmane.diabetessucks.net/map (it's a geeky thing).

I may have diabetes, but diabetes doesn't have me!



More information about the Mailman-Users mailing list