Re: [Mailman-Users] Automate Moderator Functions

2016-09-05 Thread Andre de Azevedo Cunha
Mark, 

i solved like this: 

REPLACED THIS: 

#default action (moderate)
#hold_for_approval(mlist, msg, msgdata,
# MessageTooBig(bodylen, mlist.max_message_size)) 

FOR THIS: 

#auto rejecting emails bigger then max_message_size
f_log=open('/var/log/mailman/reject','a')
f_log.write('Message from %s to %s rejected. Size exceed: %s KB\n'%
(sender, listname, bodylen/1024))
f_log.close()
rej2="Our message was rejected because is bigger then list max value (
%s KB ), please reduce the message to bellow of %s KB and try again"%
(bodylen/1024, mlist.max_message_size)
raise Errors.RejectMessage, rej2 

Thanks for your support and availability. 

Regards, 

--- 

Em 05/09/2016 12:57, Mark Sapiro escreveu:

> On 09/05/2016 07:10 AM, Andre de Azevedo Cunha wrote: 
> 
>> Mark,
>> 
>> the important to me is reject emails to the lists bigger then the value set 
>> in 
>> MAX_MESSAGE_SIZE in the list`s config. The default behavior is moderate this 
>> message, what don`t solve me problem. Exist one way to do this?
> 
> I understand what you are trying to do and what you have done should
> work. As I said in my prior reply
> 
> Em 03/09/2016 13:00, Mark Sapiro escreveu:
> 
> On 09/02/2016 01:45 PM, Andre de Azevedo Cunha wrote: 
> The message was rejected, but the sender dont receive any notify about
> that. The mailman vette log too. How can i solve this? 
> 
> Logging for rejected messages was added in 2.1.16. See
> . Prior to that, there
> won't be a vette log entry.
> 
> I don't know why there isn't a notice to the user. Is there anything in
> Mailman's error log?
> 
> As a test, add some nonmember address to the list's
> reject_these_nonmembers and send a post from that address. Does that
> receive a rejection notice?

In order to help further, I need more information. Did you look in
Mailman's error log? Did you do the test suggested above?

Send me off list a copy of your modified Mailman/Handlers/Hold.py module
and I'll look at it to see if there is a problem there.

Also, if you want rejections to be logged in vette, you can apply the
attached patch to Mailman/Queue/IncommingRunner.py.
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2016-09-05 Thread Mark Sapiro
On 09/05/2016 07:10 AM, Andre de Azevedo Cunha wrote:
> Mark,
> 
> 
> the important to me is reject emails to the lists bigger then the value set 
> in 
> MAX_MESSAGE_SIZE in the list`s config. The default behavior is moderate this 
> message, what don`t solve me problem. Exist one way to do this?


I understand what you are trying to do and what you have done should
work. As I said in my prior reply


> Em 03/09/2016 13:00, Mark Sapiro escreveu:
> 
>> On 09/02/2016 01:45 PM, Andre de Azevedo Cunha wrote:
>>>
>>> The message was rejected, but the sender dont receive any notify about
>>> that. The mailman vette log too. How can i solve this?
>>
>>
>> Logging for rejected messages was added in 2.1.16. See
>> . Prior to that, there
>> won't be a vette log entry.
>>
>> I don't know why there isn't a notice to the user. Is there anything in
>> Mailman's error log?
>>
>> As a test, add some nonmember address to the list's
>> reject_these_nonmembers and send a post from that address. Does that
>> receive a rejection notice?


In order to help further, I need more information. Did you look in
Mailman's error log? Did you do the test suggested above?

Send me off list a copy of your modified Mailman/Handlers/Hold.py module
and I'll look at it to see if there is a problem there.

Also, if you want rejections to be logged in vette, you can apply the
attached patch to Mailman/Queue/IncommingRunner.py.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
=== modified file 'Mailman/Queue/IncomingRunner.py'
--- Mailman/Queue/IncomingRunner.py	2005-08-27 01:40:17 +
+++ Mailman/Queue/IncomingRunner.py	2012-10-21 20:32:18 +
@@ -165,6 +165,13 @@
 # longer needs to be queued.
 return 0
 except Errors.RejectMessage, e:
+# Log this.
+syslog('vette', """Message rejected, msgid: %s
+list: %s,
+handler: %s,
+reason: %s""",
+   msg.get('message-id', 'n/a'),
+   mlist.real_name, handler, e.notice())
 mlist.BounceMessage(msg, msgdata, e)
 return 0
 except:

--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Automate Moderator Functions

2016-09-05 Thread Andre de Azevedo Cunha
Mark, 

the important to me is reject emails to the lists bigger then the value
set in MAX_MESSAGE_SIZE in the list`s config. The default behavior is
moderate this message, what don`t solve me problem. Exist one way to do
this?

---

Em 03/09/2016 13:00, Mark Sapiro escreveu:

> On 09/02/2016 01:45 PM, Andre de Azevedo Cunha wrote: 
> 
>> i`m trying to reject messages bigger then MAX_MESSAGE_SIZE.  
>> 
>> I configured my Hold.py was described bellow:
>> 
>> replaced
>> 
>> 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_
>> 
>> The message was rejected, but the sender dont receive any notify about
>> that. The mailman vette log too. How can i solve this?
> 
> Logging for rejected messages was added in 2.1.16. See
> . Prior to that, there
> won't be a vette log entry.
> 
> I don't know why there isn't a notice to the user. Is there anything in
> Mailman's error log?
> 
> As a test, add some nonmember address to the list's
> reject_these_nonmembers and send a post from that address. Does that
> receive a rejection notice?
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2016-09-03 Thread Mark Sapiro
On 09/02/2016 01:45 PM, Andre de Azevedo Cunha wrote:
> 
> i`m trying to reject messages bigger then MAX_MESSAGE_SIZE.  
> 
> I configured my Hold.py was described bellow:
> 
> replaced
> 
>  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_
> 
> The message was rejected, but the sender dont receive any notify about
> that. The mailman vette log too. How can i solve this? 


Logging for rejected messages was added in 2.1.16. See
. Prior to that, there
won't be a vette log entry.

I don't know why there isn't a notice to the user. Is there anything in
Mailman's error log?

As a test, add some nonmember address to the list's
reject_these_nonmembers and send a post from that address. Does that
receive a rejection notice?

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2016-09-03 Thread Andre de Azevedo Cunha
Hi, 

i`m trying to reject messages bigger then MAX_MESSAGE_SIZE.  

I configured my Hold.py was described bellow:

replaced

 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_

The message was rejected, but the sender dont receive any notify about
that. The mailman vette log too. How can i solve this? 

Thanks, 

André 

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 The highway is for
gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

-- 
 

Links:
--
[1] http://mail.python.org/mailman/listinfo/mailman-users
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Automate Moderator Functions

2012-10-02 Thread Dennis Putnam
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.





signature.asc
Description: OpenPGP digital signature
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Automate Moderator Functions

2012-10-02 Thread Mark Sapiro
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 m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


[Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Dennis Putnam
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.



signature.asc
Description: OpenPGP digital signature
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Odhiambo Washington
On Mon, Sep 24, 2012 at 3:50 PM, Dennis Putnam d...@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.
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Malcolm Austen
On Mon, 24 Sep 2012 14:02:07 +0100, Odhiambo Washington  
odhia...@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/
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Malcolm Austen
On Mon, 24 Sep 2012 13:50:13 +0100, Dennis Putnam d...@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/
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Dennis Putnam
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: br...@emwd.com
 http://www.emwd.com

 Facebook http://www.facebook.com/pages/EMWDcom/192156034142506
 LinkedIn http://www.linkedin.com/in/brianemwd



signature.asc
Description: OpenPGP digital signature
--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Re: [Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Brian Carpenter


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: br...@emwd.com
http://www.emwd.com

Facebook http://www.facebook.com/pages/EMWDcom/192156034142506 
LinkedIn http://www.linkedin.com/in/brianemwd

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Automate Moderator Functions

2012-09-24 Thread Mark Sapiro
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 m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org