18 Feb
2021
18 Feb
'21
6:21 p.m.
On 2/18/21 9:37 AM, Vako Nicolian wrote:
Using MM 2.1.33 When I send an email to /{list}-request@{domain.com} /with /who <password> /on the subject line, I get a list of the members of the list.
Here are my questions: A) Is there a way to export the list to cvs or txt format?
copy/paste
B) Can we format the list to have it come in name 1st and then email> C) display number of members D) Sort the list
These things can be done by manipulating the copy/paste result to turn it into a .csv and importing that into a spreadsheet.
For example, piping this input
Non-digest (regular) members:
user1@example.com (User One)
user2@example.com
Digest members:
user3@example.com (Three, User)
user4@example.com
through this script
#! /usr/bin/env python
import sys
from email.utils import parseaddr
flag = ''
for line in sys.stdin.readlines():
if line.startswith('Non-digest'):
flag = 'Reg'
continue
if line.startswith('Digest'):
flag = 'Dig'
continue
name, addr = parseaddr(line)
print('"{}",{},{}'.format(name, addr, flag))
produces this output
"User One",user1@example.com,Reg
"",user2@example.com,Reg
"Three, User",user3@example.com,Dig
"",user4@example.com,Dig
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan