On 05/07/2014 04:50 PM, Mark Sapiro wrote:
>
> On the other hand, it is a bit of overkill to do these as withlist
> scripts because of the withlist setup and takedown. You could, e.g., do
> something like
>
> #! /path/to/bin/python
> import sys
> import paths
> from Mailman import MailList
> from Mailman.Errors import MMUnknownListError, NotAMemberError
> try:
> mlist = MailList.MailList(sys.argv[1])
> except MMUnknownListError:
> print 'No such list: %s' % sys.argv[1]
> sys.exit(1)
> try:
> print mlist.getMemberName(sys.argv[2])
> except NotAMemberError:
> print 'No address matched: %s' % member
>
There are two errors in the above.
The 7th line should be
mlist = MailList.MailList(sys.argv[1], lock=False)
and the last line should be
print 'No address matched: %s' % sys.argv[2]
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org