[Mailman-Users] Re: [ext] List_Members from Command Line Permission

2024-06-28 Thread Dennis Putnam

On 6/28/2024 12:06 PM, Ralf Hildebrandt via Mailman-Users wrote:

* Dennis Putnam:


I am developing a script that gets a list of members from a mailing list
(mailman 2.1.15). I'm using popen (in python 2.7.5) to issue the command.
However, even though I am running it as admin for that list, I'm getting a
permissions error. How/what do I need to set in order to run that command?

def getUsers():
     "This function returns a list of users from mailman"
p=subprocess.Popen(["/usr/lib/mailman/bin/list_members","listname"],stdout=subprocess.PIPE)
     lines=p.stdout.readlines()
     p.wait
     return(lines)

I guess the script must run as user "mailman" or "root"
Which error messag exactly?


Hi Talf,

Thanks for the reply. Here is the python traceback.Traceback (most 
recent call last): File "/usr/lib/mailman/bin/list_members", line 286, 
in  main() File "/usr/lib/mailman/bin/list_members", line 230, 
in main mlist = MailList.MailList(listname, lock=False) File 
"/usr/lib/mailman/Mailman/MailList.py", line 130, in __init__ 
self.Load() File "/usr/lib/mailman/Mailman/MailList.py", line 655, in 
Load dict, e = self.__load(file) File 
"/usr/lib/mailman/Mailman/MailList.py", line 620, in __load fp = 
open(dbfile) IOError: [Errno 13] Permission denied: 
'/var/lib/mailman/lists/cufsalumni/config.pck' I didn't think about 
running it as mailman (really dumb). Yes it works if run as mailman. 
Thanks again.


OpenPGP_signature.asc
Description: OpenPGP digital signature
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org


[Mailman-Users] Re: [ext] List_Members from Command Line Permission

2024-06-28 Thread Ralf Hildebrandt via Mailman-Users
* Dennis Putnam :

> I am developing a script that gets a list of members from a mailing list
> (mailman 2.1.15). I'm using popen (in python 2.7.5) to issue the command.
> However, even though I am running it as admin for that list, I'm getting a
> permissions error. How/what do I need to set in order to run that command?
> 
> def getUsers():
>     "This function returns a list of users from mailman"
> p=subprocess.Popen(["/usr/lib/mailman/bin/list_members","listname"],stdout=subprocess.PIPE)
>     lines=p.stdout.readlines()
>     p.wait
>     return(lines)

I guess the script must run as user "mailman" or "root"
Which error messag exactly?

-- 
Ralf Hildebrandt
Charité - Universitätsmedizin Berlin
Geschäftsbereich IT | Abteilung Netz | Netzwerk-Administration
Invalidenstraße 120/121 | D-10115 Berlin

Tel. +49 30 450 570 155
ralf.hildebra...@charite.de
https://www.charite.de


signature.asc
Description: PGP signature
--
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@jab.org