# Copyright (C) 2019 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. """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()