"""Raise the dmarc_moderation_action for a list or lists to the value of DEFAULT_DMARC_MODERATION_ACTION if the list setting is lower. Save as bin/set_dmarc.py Run via bin/withlist -r set_dmarc or bin/withlist -a -r set_dmarc to do all lists. """ from Mailman import mm_cfg def set_dmarc(mlist): if not mlist.Locked(): mlist.Lock() changed = False if mlist.dmarc_moderation_action < mm_cfg.DEFAULT_DMARC_MODERATION_ACTION: mlist.dmarc_moderation_action = mm_cfg.DEFAULT_DMARC_MODERATION_ACTION changed = True if changed: mlist.Save() mlist.Unlock()