public inbox for [email protected]
help / color / mirror / Atom feedFrom: Álvaro Herrera <[email protected]>
Subject: [PATCH] Rename moderation constant, fix message
Date: Fri, 3 Jul 2026 15:26:27 +0200
---
lib/baselib/lists.py | 6 +++---
lib/handlers/mailhandler.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/baselib/lists.py b/lib/baselib/lists.py
index ec1efd6..51dbb2c 100644
--- a/lib/baselib/lists.py
+++ b/lib/baselib/lists.py
@@ -87,7 +87,7 @@ class ModerationReason(object):
CC = 13
DKIMINVALID = 14
DKIMLISTHEADER = 15
- EMPTYSUBJECT = 16
+ SUBJECT_TOO_SHORT = 16
_messages = {
OTHER: 'Other reason: {0}',
@@ -106,7 +106,7 @@ class ModerationReason(object):
CC: 'message was CCed to multiple lists',
DKIMINVALID: 'message has an invalid DKIM header',
DKIMLISTHEADER: 'message is DKIM signing list headers',
- EMPTYSUBJECT: 'message had an empty subject',
+ SUBJECT_TOO_SHORT: 'the message subject is too short',
}
def __init__(self, reason, extra=''):
@@ -130,7 +130,7 @@ class ModerationReason(object):
if is_superuser and self.reason in (self.SENDER_NOTSUBSCRIBER_LIST, self.SENDER_NOT_CONFIRMED,
self.SPAM, self.BCC, self.CC, self.SIZE, self.UNSUBSCRIBE,
- self.DKIMINVALID, self.DKIMLISTHEADER, self.EMPTYSUBJECT,
+ self.DKIMINVALID, self.DKIMLISTHEADER, self.SUBJECT_TOO_SHORT,
):
yield (ModerationOption.BLOCKLIST_SENDER, "Blocklist sender")
yield (ModerationOption.BLOCKLIST_DOMAIN, "Blocklist sender domain")
diff --git a/lib/handlers/mailhandler.py b/lib/handlers/mailhandler.py
index 71a7d4e..1811371 100644
--- a/lib/handlers/mailhandler.py
+++ b/lib/handlers/mailhandler.py
@@ -571,7 +571,7 @@ ORDER BY 1""",
# (almost) empty subject?
if len(self.subject) < 4:
self.moderate(ModerationReason(
- ModerationReason.EMPTYSUBJECT,
+ ModerationReason.SUBJECT_TOO_SHORT,
"Subject '{}' is 3 characters or less".format(self.subject),
))
return True
--
2.47.3
--caw6hg3wr3z62ogt--
view thread (113+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] Rename moderation constant, fix message
In-Reply-To: <no-message-id-11723@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox