diff options
| author | Barry Warsaw | 2017-07-26 23:24:18 +0000 |
|---|---|---|
| committer | Barry Warsaw | 2017-07-26 23:24:18 +0000 |
| commit | ade94e8f833a9472ba9be52a08f4e2f381e7a212 (patch) | |
| tree | 5fba570b0c6f4c0919009cb6f455c18bc732192a /src/mailman/rules/dmarc.py | |
| parent | 02826321d0430d7ffc1f674eeff4221941689ef7 (diff) | |
| parent | bea94cb9538a55b1376afd42c2ce751efce62cfe (diff) | |
| download | mailman-ade94e8f833a9472ba9be52a08f4e2f381e7a212.tar.gz mailman-ade94e8f833a9472ba9be52a08f4e2f381e7a212.tar.zst mailman-ade94e8f833a9472ba9be52a08f4e2f381e7a212.zip | |
Diffstat (limited to 'src/mailman/rules/dmarc.py')
| -rw-r--r-- | src/mailman/rules/dmarc.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mailman/rules/dmarc.py b/src/mailman/rules/dmarc.py index 90fff0855..9f9b11673 100644 --- a/src/mailman/rules/dmarc.py +++ b/src/mailman/rules/dmarc.py @@ -307,17 +307,23 @@ class DMARCMitigation: msgdata['dmarc'] = True if mlist.dmarc_mitigate_action is DMARCMitigateAction.discard: msgdata['moderation_action'] = 'discard' - msgdata['moderation_reasons'] = [_('DMARC moderation')] + with _.defer_translation(): + # This will be translated at the point of use. + msgdata.setdefault('moderation_reasons', []).append( + _('DMARC moderation')) elif mlist.dmarc_mitigate_action is DMARCMitigateAction.reject: listowner = mlist.owner_address # noqa F841 - reason = (mlist.dmarc_moderation_notice or - _('You are not allowed to post to this mailing ' - 'list From: a domain which publishes a DMARC ' - 'policy of reject or quarantine, and your message' - ' has been automatically rejected. If you think ' - 'that your messages are being rejected in error, ' - 'contact the mailing list owner at ${listowner}.')) - msgdata['moderation_reasons'] = [wrap(reason)] + with _.defer_translation(): + # This will be translated at the point of use. + reason = (mlist.dmarc_moderation_notice or _( + 'You are not allowed to post to this mailing ' + 'list From: a domain which publishes a DMARC ' + 'policy of reject or quarantine, and your message' + ' has been automatically rejected. If you think ' + 'that your messages are being rejected in error, ' + 'contact the mailing list owner at ${listowner}.')) + msgdata.setdefault('moderation_reasons', []).append( + wrap(reason)) msgdata['moderation_action'] = 'reject' else: return False |
