Hi,
from a previous mail:
On Tuesday 19 April 2005 04:59 pm, Michael Loftis wrote:
IS there any pre-built way of getting a list of users disabled for bouncing for a given list (CLI or web...)? Or am I just going to have to throw something together using withlist? bin/list_members --nomail=bybounce [listname]
I did this on my list, but it does not give me the addresses with a bounce score > 0.
How do I get a list of all the subscribers with a bounce score > 0 (and not de-activated)?
Thanks
Nico
On Apr 22, 2005, at 21:44, Nico wrote:
How do I get a list of all the subscribers with a bounce score > 0 (and not de-activated)?
You can use bin/withlist to review getBouncingMembers(). If you want details about last bounce, how many bounce notifications, you can use getBounceInfo(member):
$ bin/withlist mylist
from Mailman.MemberAdaptor import ENABLED for member in m.getBouncingMembers(): ... if m.getDeliveryStatus(member) == ENABLED: ... print member ... print m.getBounceInfo(member) ...
Depending on your goal, you may want to further filter this list based on how "fresh" the last bounce is.
-- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/crew/jwt/ Mailman IRC irc://irc.freenode.net/#mailman
Is there no way way to do this either via the web interface or by e-mail to the "request" address? I do not host the lists I administer, and I need to get a listing of NOMAIL subscribers for several lists. Perhaps some form of the "who" command?
On 4/24/05, Jim Tittsler <jwt@onjapan.net> wrote:
On Apr 22, 2005, at 21:44, Nico wrote:
How do I get a list of all the subscribers with a bounce score > 0 (and not de-activated)?
You can use bin/withlist to review getBouncingMembers(). If you want details about last bounce, how many bounce notifications, you can use getBounceInfo(member):
$ bin/withlist mylist
from Mailman.MemberAdaptor import ENABLED for member in m.getBouncingMembers(): ... if m.getDeliveryStatus(member) == ENABLED: ... print member ... print m.getBounceInfo(member) ...
Allen Watson wrote:
Is there no way way to do this either via the web interface or by e-mail to the "request" address? I do not host the lists I administer, and I need to get a listing of NOMAIL subscribers for several lists. Perhaps some form of the "who" command?
The closest thing you can do directly is get the list roster page either from the listinfo page or directly at http://www.example.com/mailman/roster/<listname>. This roster has delivery-disabled members shown in parenthesis, but not the reason.
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.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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@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:
participants (4)
-
Allen Watson
-
Jim Tittsler
-
Mark Sapiro
-
Nico