Re: [Mailman-Developers] My admins speak out...

if getattr(mlist, 'auto_reject', 0): raise DiscardMessage
Very nice; had no idea that one little exception is all it takes.
Is there anything similarly-simple to generate a generic bounce message and discard, or is that all "call some reply method and then raise DiscardMessage"?

"DM" == Dan Mick <Dan.Mick@West.Sun.COM> writes:
>> if getattr(mlist, 'auto_reject', 0): raise DiscardMessage
DM> Very nice; had no idea that one little exception is all it
DM> takes.
That only works for pipeline Handlers modules, because they're wrapped in the try/except inside do_pipeline().
DM> Is there anything similarly-simple to generate a generic
DM> bounce message and discard, or is that all "call some reply
DM> method and then raise DiscardMessage"?
Correct. But generating an outgoing message is fairly easy. See the Message.UserNotification class and HandlerAPI.DeliverToUser() (for response to a single user).
-Barry

"DM" == Dan Mick <Dan.Mick@West.Sun.COM> writes:
>> if getattr(mlist, 'auto_reject', 0): raise DiscardMessage
DM> Very nice; had no idea that one little exception is all it
DM> takes.
That only works for pipeline Handlers modules, because they're wrapped in the try/except inside do_pipeline().
DM> Is there anything similarly-simple to generate a generic
DM> bounce message and discard, or is that all "call some reply
DM> method and then raise DiscardMessage"?
Correct. But generating an outgoing message is fairly easy. See the Message.UserNotification class and HandlerAPI.DeliverToUser() (for response to a single user).
-Barry
participants (2)
-
barry@wooz.org
-
Dan Mick