[Mailman-Developers] Admin-controlled rejectiontext...

Mark Sapiro msapiro at value.net
Fri Jan 21 03:55:51 CET 2005


Brad Knowles wrote:

>At 3:56 PM +0100 2005-01-20, Brad Knowles wrote:
>
>>  	Problem is, while we can provide a %()s substitution ourselves in
>>  the text we feed to Utils.wrap, I can't do the same thing from
>>  member_moderation_notice.  Instead, it simply outputs the literal
>>  string, and gives me "<" and ">" as opposed to the real
>>  less-than/greater-than symbols that I want to use around the URLs.
>>
>>  	I'm stumped.  I don't even know what to search for in the archives
>>  of the mailman-users and mailman-developers lists.
>
>	I just realized that I should give you folks an example of what 
>I'm talking about.  With my modified do_reject(), I put the following 
>text into the member_moderation_notice field:
>
>		Please note that this mailing list has been closed to postings
>		via e-mail from non-subscribers.
>
>		If you wish to subscribe to this mailing list, please go to
>		the web page at <https://url.here/mailman/listinfo/listname>
>		and follow the instructions there.
>
>		If you think that your messages are being rejected in error,
>		please contact the mailing list owner at %(listowner)s.
>
>
>	Here's the literal text that I'm getting back in the error message:
>
>		Please note that this mailing list has been closed to postings
>		via e-mail from non-subscribers.
>
>		If you wish to subscribe to this mailing list, please go to
>		the web page at &lt;https://url.here/mailman/listinfo/listname&gt;
>		and follow the instructions there.
>
>		If you think that your messages are being rejected in error,
>		please contact the mailing list owner at %(listowner)s.
>
>
>	Notice how we have the undesirable "%lt;" and "%gt;" instead of 
>the proper less-than/greather-than symbols, and the literal 
>"%(listowner)s" instead of the actual listowner address.
>
>	Now, here's the default text being fed in via do_reject:
>
>		You are not allowed to post to this mailing list, and your
>		message has been automatically rejected.  If you think that
>		your messages are being rejected in error, contact the
>		mailing list owner at %(listowner)s.
>
>
>	Finally, here's how that default text looks in the rejection message:
>
>		You are not allowed to post to this mailing list, and your
>		message has been automatically rejected.  If you think that
>		your messages are being rejected in error, contact the
>		mailing list owner at listname-owner at url.here.
>
>
>
>	What process is being applied to the literal text supplied within 
>the program, that is not being applied to the 
>member_moderation_notice?  How do I make sure that process *is* 
>applied to the member_moderation_notice?


There are two different issues here I think.

First is all text entered via the web admin interface is HTML escaped
resulting in the &lt;, etc.

To avoid this, set the text for member_moderation_notice using
bin/config_list instead of using the web interface.

The second issue is the non replacement of %(listowner)s in your text.
As I understand it, the substitution occurs in i18n._() processing of
the text. The literal text occurs in

>Utils.wrap(_("""\
>You are not allowed to post to this mailing list, and your message has been
>automatically rejected.  If you think that your messages are being rejected in
>error, contact the mailing list owner at %(listowner)s."""))

The _() method both replaces this text with the appropriate language
translation if the current language is not English and does the %()s
substitutions.

Your member_moderation_notice text isn't being processed in this way.

--
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Developers mailing list