Re: [Mailman-Users] Modifying Privacy.py

2016-02-28 Thread ListGnome ProtonMail via Mailman-Users
Thanks Mark,

That worked, with one little "gotcha". I found that after editing Privacy.py, I 
had to go to the admin page of the list and although the Privacy option was 
showing "Requires approval" - until I re-submitted the Privay Options page it 
would operate as if it were set on "Confirm".

To recap for anyone else interested:

1. Edit /usr/lib/mailman/Mailman/Gui/Privacy.py

ABOUT LINES 77 TO 90, CHANGE:


else:
sub_cfentry = ('subscribe_policy', mm_cfg.Radio,
# choices
(_('Confirm'),
_('Require approval'),
_('Confirm and approve')),
1,
_('What steps are required for subscription?'),
_('''Confirm (*) - email confirmation required 
Require approval - require list administrator
approval for subscriptions 
Confirm and approve - both confirm and approve


TO:


else:
sub_cfentry = ('subscribe_policy', mm_cfg.Radio,
# choices
(_('Require approval'),
_('Confirm and approve')),
1,
_('What steps are required for subscription?'),
_('''Require approval - require list administrator
approval for subscriptions 
Confirm and approve - both confirm and approve



ABOUT LINE 554, CHANGE:

if property == 'subscribe_policy' and not mm_cfg.ALLOW_OPEN_SUBSCRIBE:
val += 1

TO:

if property == 'subscribe_policy' and not mm_cfg.ALLOW_OPEN_SUBSCRIBE:
val += 2


2. RESTART MAILMAN

3. Go to the list's admin page and select (re-select) "Require approval"
or "Confirm and approve" and submit the page.


 Original Message 
Subject: Re: [Mailman-Users] Modifying Privacy.py
Local Time: February 24, 2016 11:17 am
UTC Time: February 24, 2016 12:17 AM
From: m...@msapiro.net
To: mailman-users@python.org

On 02/23/2016 03:44 PM, ListGnome ProtonMail via Mailman-Users wrote:
>
> There are currently three option and I'm trying to remove "Confirm"
> so that the only two options remain - "Require approval" and "Confirm
> and approve".
>
> In the file "/usr/lib/mailman/Mailman/Gui/Privacy.py" I've tried
> removing the lines that relate to "Confirm" - and as expected the
> Admin page looks okay with only the two desired options showing.
> However, what happens when someone subscribs is they actually get the
> "Confirm" process - rather than the expected "Requires approval".
>
> Is there another file I need to be looking at also? Or am I most
> likely just screwing up the "Privacy.py" file?


It's much more complicated than that. There are actually four possible
values for subscribe_policy. These values and their meanings are

0 -> Open subscribe, no confirm or approve.
1 -> Confirm, require user confirmation
2 -> Require approval
3 -> Confirm and approve, require user confirmation, then approval

There is already code in Mailman/Gui/Privacy.py to test the
mm_cfg.ALLOW_OPEN_SUBSCRIBE setting and if it is false, not display the
open subscribe choice AND increment the return value allow for it's not
being there.

By removing the "Confirm" choice you are left with two choices whose
returned POST values will be 0 and 1. The mm_cfg.ALLOW_OPEN_SUBSCRIBE
code will increment the return, so the two choices are 1 and 2 which are
'Confirm' and 'Require approval' Regardless of what the words say.

So Assuming you will NEVER set ALLOW_OPEN_SUBSCRIBE = Yes, you can just
change the statement in the definition of _setValue() in
Mailman/Gui/Privacy.py from

if property == 'subscribe_policy' and not
mm_cfg.ALLOW_OPEN_SUBSCRIBE:
val += 1

to

if property == 'subscribe_policy' and not
mm_cfg.ALLOW_OPEN_SUBSCRIBE:
val += 2


--
Mark Sapiro <m...@msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better 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/listgnome%40protonmail.ch
--
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


[Mailman-Users] Modifying Privacy.py

2016-02-23 Thread ListGnome ProtonMail via Mailman-Users
Hi All,
I'm attempting to modify the subscription options in the Admin section under 
"Privacy options: What steps are required for subscription?".

There are currently three option and I'm trying to remove "Confirm" so that the 
only two options remain - "Require approval" and "Confirm and approve".

In the file "/usr/lib/mailman/Mailman/Gui/Privacy.py" I've tried removing the 
lines that relate to "Confirm" - and as expected the Admin page looks okay with 
only the two desired options showing. However, what happens when someone 
subscribs is they actually get the "Confirm" process - rather than the expected 
"Requires approval".

Is there another file I need to be looking at also? Or am I most likely just 
screwing up the "Privacy.py" file?

Thanks,
Mark
--
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] Reverse chronological date order for archives

2015-11-25 Thread ListGnome ProtonMail via Mailman-Users
Hi Mark,


I've tested the modified HyperDatabase.py file and it does indeed reverse the 
chronological order of the archives (but only in date view).
And also as you said, it was necessary to "/bin/arch --wipe LISTNAME" to 
reverse any existing archives.

Thanks again,
Mark

***
And the patch refactored for style against 2.1.20 is

$ diff -u 2.1/Mailman/Archiver/HyperDatabase.py

def first(self, archive, index):
self.__openIndices(archive)
+ if index == 'date':
+ dateIndex = 1
+ else:
+ dateIndex = 0
index = getattr(self, index + 'Index')
try:
+ if dateIndex == 1:
+ index.sorted.reverse()
key, msgid = index.first()
return msgid
except KeyError:
--
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


[Mailman-Users] Reverse chronological date order for archives

2015-11-18 Thread ListGnome ProtonMail via Mailman-Users
Hi,

Has anyone been able to order their archive messages in reverse chronological 
date order - so the most recent post is at the top of the page. (Version 2.1.20)

I found a related thread in the Mailman-Users archive (dated 2002) but it 
didn't explain how it was done.

https://mail.python.org/pipermail/mailman-users/2002-February/017906.html

Any clues greatly appreciated.

Cheers,
Mark
--
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