
On 09/04/2014 12:24 PM, Fabio Eckhardt wrote:
I've been checking the forum on how to automatically reject messages size at this link:
https://mail.python.org/pipermail/mailman-users/2007-October/058752.html
The function:
* if bodylen/1024.0 > mlist.max_message_size: raise Errors.RejectMessage, Utils.wrap( MessageTooBig(bodylen, mlist.max_message_size).reason_notice())*
Only this class (function) only works for registered mail list, you would have to do to members not registered on the list?
If you are saying that a member post that is too big will be rejected by the above, but a non-member post that is too big will be held as a post from a non-member, this is correct.
This occurs because miscellaneous holds such as "too big" are processed by the Hold handler but non-member actions are processed by the Moderate handler which comes first in the pipeline.
There's not much you can do about this. Reordering the pipeline to put Hold before Moderate is a bad idea because then other miscellaneous holds would take precedence over membership decisions.
You could change generic_nonmember_action to Reject, but this may be unwanted for other reasons.
Perhaps the best approach is to implement a custom handler to reject 'too big' posts and put it in the pipeline, maybe only this list's pipeline, ahead of Moderate. See the FAQ at <http://wiki.list.org/x/l4A9>.
And finally could be administrator or refer to the list owner's email rejected ?
I don't understand what you're asking? If you mean could the list owner be sent a notice of the rejected post, then yes, that could be coded too.
If you can specify exactly what you want to happen to "too big" posts from members, moderated members and non-members, I can help you with the actual code.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan