[Mailman-Users] Listing bouncing addresses
Mark Sapiro
msapiro at value.net
Sun Jun 5 00:40:06 CEST 2005
Mark Sapiro wrote:
>
>You can also script the web interface. See
>http://starship.python.net/crew/jwt/mailman/#throughtheweb for an
>example of a script to get the member list from the web. This could
>probably be modified to show only those members with delivery disabled
>for bouncing.
A patch to add a {-n|--nomail} option to Jim's script is appended to
this mail. The option will list all members with delivery disabled for
any reason and doesn't report the reason. Maybe someone else wants to
try that. The patch works for the one list I tried it on.
Watch for 'folded lines'. There are a couple in the context, but I
think none in the added/changed code.
--
Mark Sapiro <msapiro at value.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
--- mailman-subscribers.py 2005-03-05 18:00:12.406250000 -0800
+++ mailman-subscribers-nm.py 2005-06-04 15:20:23.531250000 -0700
@@ -11,6 +11,7 @@
# of ClientCookie is detected
# 2005-02-16 jwt use Python 2.4's cookielib if it is available
# 2005-02-27 jwt only visit the roster page for letters that exist
+# 2005-06-04 mas add --nomail option
"""List the email addresses subscribed to a mailing list, fetched from
web.
@@ -25,6 +26,10 @@
-f
Include the full names in the output.
+ --nomail
+ -n
+ List only no-mail members
+
--verbose
-v
Include extra progress output.
@@ -94,6 +99,7 @@
sys.exit(code)
subscribers = {}
+nomails = {}
maxchunk = 0
letters = ['a']
processed_letters = []
@@ -113,6 +119,15 @@
subname = v
if s and not subscribers.has_key(subemail):
subscribers[subemail] = subname
+ t = False
+ for a,v in attrs:
+ if a == 'name' and v.endswith('_nomail'):
+ nmemail = v[:-7]
+ t = True
+ elif a == 'value':
+ subnomail = v
+ if t and not nomails.has_key(nmemail):
+ nomails[nmemail] = subnomail
if tag == 'a':
for a,v in attrs:
if a == 'href' and v.find('/mailman/admin/'):
@@ -130,13 +145,14 @@
def main():
global maxchunk, letters
try:
- opts, args = getopt.getopt(sys.argv[1:], "ho:fv",
- ["help", "output=", "fullnames", "verbose"])
+ opts, args = getopt.getopt(sys.argv[1:], "ho:fnv",
+ ["help", "output=", "fullnames", "nomail", "verbose"])
except:
usage(2)
fp = sys.stdout
fullnames = False
+ nomail = False
verbose = False
for o,a in opts:
if o in ("-v", "--verbose"):
@@ -147,6 +163,8 @@
fp = open(a, "wt")
if o in ("-f", "--fullnames"):
fullnames = True
+ if o in ("-n", "--nomail"):
+ nomail = True
if len(args) != 3:
usage(2)
member_url = 'http://%s/mailman/admin/%s/members' % (args[0],
args[1])
@@ -183,6 +201,8 @@
# print the subscribers list
for (email, name) in subscriberlist:
+ if nomail and nomails[email] == "off":
+ continue
if not fullnames or name == "":
print >>fp, email
else:
More information about the Mailman-Users
mailing list