I've seen various queries on this but nothing definitive about it being added as a feature or even a customizable mod. There are certain moderator actions that potentially could be automated. For example, I would never approve a posting from a non-member of a restricted list. It would make my moderator duties much easier if I could have mailman automatically reject or discard such posts. The same might be true for exceeding the size limit. Is this something that has been considered and rejected as a feature or is it something that is doable now that I have just not been able to find? TIA.
On 9/24/2012 8:50 AM, Dennis Putnam wrote:
I've seen various queries on this but nothing definitive about it being added as a feature or even a customizable mod. There are certain moderator actions that potentially could be automated. For example, I would never approve a posting from a non-member of a restricted list. It would make my moderator duties much easier if I could have mailman automatically reject or discard such posts. The same might be true for exceeding the size limit. Is this something that has been considered and rejected as a feature or is it something that is doable now that I have just not been able to find? TIA. Hi Dennis:
In regards to non-members, you can adjust the following setting to discard on the Privacy options --> Sender Filters page:
"Action to take for postings from non-members for which no explicit action is defined."
As for the message-size exceeded messages, you can just leave them in the moderation queue and just adjust the following General Options page setting to something that would work for you:
"Discard held messages older than this number of days. Use 0 for no automatic discarding."
Someone else may have a better suggestion.
*Brian Carpenter *EMWD.com
T: 336-755-0685 E: brian@emwd.com http://www.emwd.com
Facebook <http://www.facebook.com/pages/EMWDcom/192156034142506> LinkedIn <http://www.linkedin.com/in/brianemwd>
First, thanks for all the replies.
The non-members filter seems to do exactly what I want.
However, it is not clear what the members filter is doing. If I turn that on, does it mean every message will be Held, Rejected or Discarded? That does not make sense to me as I cannot think of any circumstance where that would be useful, especially the reject and discard. I think it would make more sense if that applied to any member post that would not otherwise be distributed such as when it exceeds the size. Could someone clarify.
Thanks.
On 9/24/2012 8:59 AM, Brian Carpenter wrote:
On 9/24/2012 8:50 AM, Dennis Putnam wrote:
I've seen various queries on this but nothing definitive about it being added as a feature or even a customizable mod. There are certain moderator actions that potentially could be automated. For example, I would never approve a posting from a non-member of a restricted list. It would make my moderator duties much easier if I could have mailman automatically reject or discard such posts. The same might be true for exceeding the size limit. Is this something that has been considered and rejected as a feature or is it something that is doable now that I have just not been able to find? TIA. Hi Dennis:
In regards to non-members, you can adjust the following setting to discard on the Privacy options --> Sender Filters page:
"Action to take for postings from non-members for which no explicit action is defined."
As for the message-size exceeded messages, you can just leave them in the moderation queue and just adjust the following General Options page setting to something that would work for you:
"Discard held messages older than this number of days. Use 0 for no automatic discarding."
Someone else may have a better suggestion.
*Brian Carpenter *EMWD.com
T: 336-755-0685 E: brian@emwd.com http://www.emwd.com
Facebook <http://www.facebook.com/pages/EMWDcom/192156034142506> LinkedIn <http://www.linkedin.com/in/brianemwd>
On Mon, 24 Sep 2012 13:50:13 +0100, Dennis Putnam <dap1@bellsouth.net>
wrote:
I've seen various queries on this but nothing definitive about it being added as a feature or even a customizable mod. There are certain moderator actions that potentially could be automated. For example, I would never approve a posting from a non-member of a restricted list. It would make my moderator duties much easier if I could have mailman automatically reject or discard such posts. The same might be true for exceeding the size limit. Is this something that has been considered and rejected as a feature or is it something that is doable now that I have just not been able to find? TIA.
The latter: Privacy options > Sender filters > Non-member filters
Much used here :-)
= Malcolm =
-- Using Opera's revolutionary email client: http://www.opera.com/mail/
On Mon, Sep 24, 2012 at 3:50 PM, Dennis Putnam <dap1@bellsouth.net> wrote:
I've seen various queries on this but nothing definitive about it being added as a feature or even a customizable mod. There are certain moderator actions that potentially could be automated. For example, I would never approve a posting from a non-member of a restricted list. It would make my moderator duties much easier if I could have mailman automatically reject or discard such posts. The same might be true for exceeding the size limit. Is this something that has been considered and rejected as a feature or is it something that is doable now that I have just not been able to find? TIA.
Under Privacy settings, I can see something! Read on and see. About message size, well, content filtering uses regexps, so perhaps you can craft something.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223
I can't hear you -- I'm using the scrambler.
On Mon, 24 Sep 2012 14:02:07 +0100, Odhiambo Washington
<odhiambo@gmail.com> wrote:
About message size, well, content filtering uses regexps, so perhaps you can craft something.
I think content filtering only deals with attachments. Large messages from
non-members are no problem as they can be discarded as non-member posts
but I can't see any way to discard on message size - but then I don't feel
a need to :-)
= Malcolm =
-- Using Opera's revolutionary email client: http://www.opera.com/mail/
Dennis Putnam wrote:
The same might be true for exceeding the size limit.
To automatically reject or discard messages that exceed the list's size limit, find the section of the Mailman/Handlers/Hold.py that ends with the lines
if bodylen/1024.0 > mlist.max_message_size:
hold_for_approval(mlist, msg, msgdata,
MessageTooBig(bodylen,
mlist.max_message_size)) # no return
(there is one wrapped line in the above) and replace
hold_for_approval(mlist, msg, msgdata,
MessageTooBig(bodylen,
mlist.max_message_size))
with
rej = MessageTooBig(bodylen, mlist.max_message_size))
raise Errors.RejectMessage, rej.reason_notice
to reject the message or with
raise Errors.DiscardMessage
to discard the message. Note that this will not honor the list's forward_auto_discards setting. to do that you would need to put
from Mailman.Handlers.Moderate import do_discard
with the other imports near the beginning of the Mailman.Handlers.hold.py module and then replace the lines with
do_discard(mlist, msg)
If you are actually going to do any of the above, I suggest you also put the following in mm_cfg.py for the stated reason
# # Put MimeDel ahead of Hold so "too big" is based on content filtered # message. # GLOBAL_PIPELINE.remove('MimeDel') GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('Hold'), 'MimeDel')
Instead of modifying Hold.py, you could make a custom handler (see <http://wiki.list.org/x/l4A9>) to deal with oversized messages and put it ahead of Hold in the pipeline or possibly just replace Hold.py with a custom version.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I am getting back to this and I have a question about maintenance. What is the correct way to modify this so that it will not get destroyed by updates?
Also does this same procedure apply to other automatic rejections such as implicit destination?
Thanks.
On 9/24/2012 8:43 PM, Mark Sapiro wrote:
Dennis Putnam wrote:
The same might be true for exceeding the size limit.
To automatically reject or discard messages that exceed the list's size limit, find the section of the Mailman/Handlers/Hold.py that ends with the lines
if bodylen/1024.0 > mlist.max_message_size: hold_for_approval(mlist, msg, msgdata, MessageTooBig(bodylen,
mlist.max_message_size)) # no return
(there is one wrapped line in the above) and replace
hold_for_approval(mlist, msg, msgdata, MessageTooBig(bodylen,
mlist.max_message_size))
with
rej = MessageTooBig(bodylen, mlist.max_message_size)) raise Errors.RejectMessage, rej.reason_notice
to reject the message or with
raise Errors.DiscardMessage
to discard the message. Note that this will not honor the list's forward_auto_discards setting. to do that you would need to put
from Mailman.Handlers.Moderate import do_discard
with the other imports near the beginning of the Mailman.Handlers.hold.py module and then replace the lines with
do_discard(mlist, msg)
If you are actually going to do any of the above, I suggest you also put the following in mm_cfg.py for the stated reason
# # Put MimeDel ahead of Hold so "too big" is based on content filtered # message. # GLOBAL_PIPELINE.remove('MimeDel') GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('Hold'), 'MimeDel')
Instead of modifying Hold.py, you could make a custom handler (see <http://wiki.list.org/x/l4A9>) to deal with oversized messages and put it ahead of Hold in the pipeline or possibly just replace Hold.py with a custom version.
Dennis Putnam wrote:
I am getting back to this and I have a question about maintenance. What is the correct way to modify this so that it will not get destroyed by updates?
There are two ways to proceed.
You can modify Mailman/Handlers/Hold.py itself, but before overwriting it, make a "diff -u" between the base Hold.py and your modified version to use as a patch to apply after any upgrade.
A better way is to leave Hold.py unchanged and make your own edited version as say Mailman/Handlers/MyHold.py. Then you can replace the base Hold.py Module with your MyHold.py by putting
GLOBAL_PIPELINE[GLOBAL_PIPELINE.index('Hold')] = 'MyHold'
in mm_cfg.py. Note that if you are going to do this, and you want also to move MimeDel before Hold, you must either put the above line after the lines
GLOBAL_PIPELINE.remove('MimeDel') GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('Hold'), 'MimeDel')
in mm_cfg.py or put it before, but then also change
GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('Hold'), 'MimeDel')
to
GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('MyHold'), 'MimeDel')
I recommend the former as in
# # Put MimeDel ahead of Hold so "too big" is based on content filtered # message. # GLOBAL_PIPELINE.remove('MimeDel') GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('Hold'), 'MimeDel') # # Replace Hold with local version # GLOBAL_PIPELINE[GLOBAL_PIPELINE.index('Hold')] = 'MyHold'
Since mm_cfg.py survives upgrades, this should survive.
Also does this same procedure apply to other automatic rejections such as implicit destination?
On 9/24/2012 8:43 PM, Mark Sapiro wrote:
To automatically reject or discard messages that exceed the list's size limit, find the section of the Mailman/Handlers/Hold.py that ends with the lines
if bodylen/1024.0 > mlist.max_message_size: hold_for_approval(mlist, msg, msgdata, MessageTooBig(bodylen,
mlist.max_message_size)) # no return
(there is one wrapped line in the above) and replace
hold_for_approval(mlist, msg, msgdata, MessageTooBig(bodylen,
mlist.max_message_size))
with
rej = MessageTooBig(bodylen, mlist.max_message_size)) raise Errors.RejectMessage, rej.reason_notice
to reject the message or with
raise Errors.DiscardMessage
to discard the message. Note that this will not honor the list's forward_auto_discards setting. to do that you would need to put
from Mailman.Handlers.Moderate import do_discard
with the other imports near the beginning of the Mailman.Handlers.hold.py module and then replace the lines with
do_discard(mlist, msg)
Yes, similar changes would apply to other holds in Hold.py.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (5)
-
Brian Carpenter
-
Dennis Putnam
-
Malcolm Austen
-
Mark Sapiro
-
Odhiambo Washington