summaryrefslogtreecommitdiff
path: root/src/mailman/rules/no_subject.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rules/no_subject.py')
-rw-r--r--src/mailman/rules/no_subject.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mailman/rules/no_subject.py b/src/mailman/rules/no_subject.py
index f4d2f6a5d..9793ca2a5 100644
--- a/src/mailman/rules/no_subject.py
+++ b/src/mailman/rules/no_subject.py
@@ -37,4 +37,11 @@ class NoSubject:
# Convert the header value to a str because it may be an
# email.header.Header instance.
subject = str(msg.get('subject', '')).strip()
- return subject == ''
+ if subject == '':
+ msgdata['moderation_sender'] = msg.sender
+ with _.defer_translation():
+ # This will be translated at the point of use.
+ msgdata.setdefault('moderation_reasons', []).append(
+ _('Message has no subject'))
+ return True
+ return False