Hi all,
Ok, I did this a very long time ago, and can't for the life of me remember where/how I did this...
I have some lists that have a max_size set, and when someone sends an email that exceeds this size, it gets held for moderation, and the sender gets a notification of this, but it is a custom one that I wrote myself.
Now, I'd like to change this behavior - I want to REJECT these messages
least , change the notification text to inform them that their message will be discarded, as opposed to 'eventually dealt with'...
Any pointers to tfm would be appreciated...
On 02/25/2015 05:38 AM, Tanstaafl wrote:
I have some lists that have a max_size set, and when someone sends an email that exceeds this size, it gets held for moderation, and the sender gets a notification of this, but it is a custom one that I wrote myself.
Now, I'd like to change this behavior - I want to REJECT these messages
- but can't for the life of me figure out how to do this, or at the very
least , change the notification text to inform them that their message will be discarded, as opposed to 'eventually dealt with'...
It is possible you just modified the messages in the MessageTooBig class definition in Mailman/Handlers/Hold.py. The postheld.txt template is also involved in the notice to the user, but it is used for all held messages so it seems unlikely you changed that.
You can reject the message rather than holding it, but that would require (further) modification to Mailman/Handlers/Hold.py.
On 2/25/2015 10:21 AM, Mark Sapiro mark@msapiro.net wrote:
It is possible you just modified the messages in the MessageTooBig class definition in Mailman/Handlers/Hold.py. The postheld.txt template is also involved in the notice to the user, but it is used for all held messages so it seems unlikely you changed that.
You can reject the message rather than holding it, but that would require (further) modification to Mailman/Handlers/Hold.py.
Hmmm... ok, looks like I was mistaken, the notification is just the standard one in Hold.py.
Here is the notification they get:
Your mail to 'List-Name' with the subject
test max_size
Is being held until the list moderator can review it for approval.
The reason it is being held:
Message body is too big: 7908354 bytes with a limit of 256 KB
Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL:
https://lists.example.com:56001/mailman/confirm/List-Name/blahblah
But looking at the Handler, what I'd like for them to get is just the last notification - see below: "Your message was too big; please trim it to less than %(kb)d KB in size", but without the 'is being held until the list moderator...' stuff...
It doesn't have to be rejected, I just want the sender to know that they need to resend a smaller message.
Thanks for any suggestions...
On 02/25/2015 07:48 AM, Tanstaafl wrote:
But looking at the Handler, what I'd like for them to get is just the last notification - see below: "Your message was too big; please trim it to less than %(kb)d KB in size", but without the 'is being held until the list moderator...' stuff...
It doesn't have to be rejected, I just want the sender to know that they need to resend a smaller message.
You can make a list specific, domain specific or sitewide edited version of the postheld.txt template. See the FAQ at http://wiki.list.org/x/4030605 for where to put it.
However, this would apply to all held messages, not just 'too big' ones. If that isn't satisfactory, you'd have to modify Mailman/Handlers/Hold.py to use a different template if the reason is 'too big'.