Topics and friendly rejections of topicless messages

I'm trying to set up a list with the topics feature, and I'm having a little bit of trouble achieving what I want. The basic feature is fine, but making it a smooth user experience is being problematic. In particular, what I want is this:
A) Allow topic-based list subscription B) Every message must have a topic C) Messages that don't have a topic get bounced back to the user D) The bounced messages must be "pretty", and explain what to do
A was easy enough.
I implemented B and C by using spam filtering, and setting the spam filter to bounce mail whose subject line matches a regular expression. That regex is essentially "not (topic1 | topic2)". That solution is functional, if not particularly elegant.
Item D is throwing me for a loop. I can make it happen with a one-line change to SpamDetect.py, but that's probably not going to fly. The host runs multiple lists, and doing this would constrain the other lists in ways that aren't really acceptable.
I've wandered through this list's archives pretty extensively. If this question has been answered then I haven't found the right search incantation to get at the information. Is there a good way to accomplish what I'm trying to do? Is there a way to bounce spam to some particular email address, and run a script at that address to send back a pretty, helpful bounce?
The meta-problem that I'm trying to solve is this: there's a very active mailing list for people who attend a particular event. Some members think that the list should only be about the event and related topics, while others think that the list is for general socialization among attendees of the event. For the first group, there's disagreement about what related topics would be.
There's no split that seems to make sense. Topics is the perfect feature if I can get it to do what I want, but it's being a bit finicky.
-Patti

Patti Beadles writes:
I do this kind of thing in several Handlers. There are two ways to approach this. The easy way is that the Handler knows what list it is processing (the mlist argument to process()):
if mlist.internal_name() in my_lists:
# do my thing
The more elegant way (and not much harder) is to define a MyVeryOwnSpamDetect handler (which starts as a copy of SpamDetect.py!), save it to the Handlers directory, then insert it in the list's configuration with
$ cd /path/to/mailman/lib; bin/withlist -l mylist
And now you know why all the cool kids love Mailman!

Patti Beadles wrote:
Congratulations. Was the FAQ at <http://wiki.list.org/x/G4CE> helpful? Did you even see it?
I think a better solution to B, C and D. is a custom handler. A custom handler can be enabled for only a single list and should therefore be acceptable to the host. See the FAQ at <http://wiki.list.org/x/l4A9> for information about custom handlers.
The place in the pipeline for this particular handler is between Tagger and CalcRecips.
The handler itself can be quite simple:
from Mailman.Errors import RejectMessage
NOTICE = """Some nice text for the rejection message. """
def process(mlist, msg, msgdata): if not mlist.topics_enabled: return if not msgdata.get('topichits'): raise RejectMessage(NOTICE)
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Patti Beadles writes:
I do this kind of thing in several Handlers. There are two ways to approach this. The easy way is that the Handler knows what list it is processing (the mlist argument to process()):
if mlist.internal_name() in my_lists:
# do my thing
The more elegant way (and not much harder) is to define a MyVeryOwnSpamDetect handler (which starts as a copy of SpamDetect.py!), save it to the Handlers directory, then insert it in the list's configuration with
$ cd /path/to/mailman/lib; bin/withlist -l mylist
And now you know why all the cool kids love Mailman!

Patti Beadles wrote:
Congratulations. Was the FAQ at <http://wiki.list.org/x/G4CE> helpful? Did you even see it?
I think a better solution to B, C and D. is a custom handler. A custom handler can be enabled for only a single list and should therefore be acceptable to the host. See the FAQ at <http://wiki.list.org/x/l4A9> for information about custom handlers.
The place in the pipeline for this particular handler is between Tagger and CalcRecips.
The handler itself can be quite simple:
from Mailman.Errors import RejectMessage
NOTICE = """Some nice text for the rejection message. """
def process(mlist, msg, msgdata): if not mlist.topics_enabled: return if not msgdata.get('topichits'): raise RejectMessage(NOTICE)
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Mark Sapiro
-
Patti Beadles
-
Stephen J. Turnbull