On 2023-01-01 21:58, Mark Dale wrote:
On 2022-12-30 10:57, Jan Eden via Mailman-users wrote:
... Is there an SQL statement (or an equivalent of bin/list_members) to extract the data?
Hi Jan,
Is this what you're after?
psql -U postgres -d mailman3 -t -A -F"," -c "SELECT public.address.email public.address.display_name FROM member JOIN address on public.address.id = public.member.address_id WHERE list_id = 'mylist.mydomain.com' AND role = 1" > $(date +%Y-%m-%d).members.txt
(replace mylist.mydomain.com with yours)
OOPs, missed a comma in the above. It should be:
psql -U postgres -d mailman3 -t -A -F"," -c "SELECT public.address.email, public.address.display_name FROM member JOIN address on public.address.id = public.member.address_id WHERE list_id = 'mylist.mydomain.com' AND role = 1" > $(date +%Y-%m-%d).members.txt