Re: [Mailman-Developers] Mailman MySQL adaptor - MySQLdb module error

2010-08-12 Thread Aaron Kreider



I found a solution!

Mark Sapiro deserves all the credit for helping me out a TON
=)

Here is my documentation in the hope that it will help someone in the future.



---


Mark writes:
The basic problem is that the python library or at least the one
containing the site-packages/ into which MySQLdb was installed is
/usr/lib64/python2.4 rather than /usr/lib/python2.4.

Mailman starts a lot of Python processes with the -S option which
bypasses importing the site module at startup and this is what
normally puts the path to site-packages in sys.path. Mailman attempts
to do this itself in its own paths module which everything imports,
but it assumes the path begins with /usr/lib/pythonv.v so it never got
/usr/lib64/python2.4/site-packages into sys.path.

The bit added to extend.py does this when it replaces the
MemberAdaptor, so MysqlMemberships can successfully import MySQLdb.



--
Aaron adds:

We changed extend.py to be:

import sys
if '/usr/lib64/python2.4/site-packages' not in sys.path:
sys.path.append('/usr/lib64/python2.4/site-packages')

from Mailman.MysqlMemberships import MysqlMemberships

def extend(list):
list._memberadaptor = MysqlMemberships(list)




--

To track down the fact that the module's directory was wrong we had to fix a 
bug in Mailman's error logging:

There is a bug in the error logging code in
/usr/local/cpanel/3rdparty/mailman/scripts/driver

Edit that file. Find

def print_environment(logfp=None):
if logfp is None:
logfp = sys.__stderr__

try:
import os
except ImportError:
os = None

# Write some information about our Python executable to the log
file.
print  logfp, '[- Python Information -]'
print  logfp, 'sys.version =', sys.version
print  logfp, 'sys.executable  =', sys.executable
print  logfp, 'sys.prefix  =', sys.prefix
print  logfp, 'sys.exec_prefix =', sys.exec_prefix
print  logfp, 'sys.path=', sys.exec_prefix
print  logfp, 'sys.platform=', sys.platform


Change the next to last line of that from

print  logfp, 'sys.path=', sys.exec_prefix

to

print  logfp, 'sys.path=', sys.path

and then see what's reported for sys.path in the traceback.

---


Finally because my Cpanel installation of mailman was creating mailing lists that had 
. in their name, and MySQL does not create tables with a period in the name I 
modified the code for MysqlMemberships.py

A global replace of

  self.__mlist.internal_name()

with

  self.__mlist.internal_name().replace('.', '_')









___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


[Mailman-Developers] Exporting member info (including options)

2010-08-12 Thread Aaron Kreider

 Is there a good way to export all of the member info for a list?

I want all the mailing list options as well as the email address, so 
that I can import it into MySQL and use the MySQL adaptor.


I know list_members gives just the email addresses.

Is the best method for me to use dbdump to access the pickle files and 
then write a script to parse that?


Aaron

--
Energy Justice Communities Map Developer - http://www.energyjustice.net/map

___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


[Mailman-Developers] MySQL adaptor - storing in a remote database - ping times

2010-08-12 Thread Aaron Kreider
 I'm using the MySQL adaptor and am wondering whether it is acceptable 
to have the database in a remote location with a 30 ms ping time between 
it and the server that runs mailman? We'd be running medium sized lists 
of 100-300 subscribers.  It depends on whether the MySQL adaptor will do 
a couple queries to send out an email, or if it does a query for every 
single subscriber (in which case a ping time of 30 ms is unacceptable).


My organization has a database that is on a server in our office and our 
website server is located in a different spot.  So if we had the Mailman 
database in our office, it would integrate faster and easier with the 
rest of the organization database.



--
Energy Justice Communities Map Developer - http://www.energyjustice.net/map

___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] MM3 nntp support?

2010-08-12 Thread Tanstaafl
No response?

Tanstaafl wrote:
 Hello,
 
 Back in December Barry had mentioned that he was exploring adding nntp
 (and IMAP) support to the archives, but didn't clarify much further...
 and I googled quite a bit, and these 2 or 3 posts on the subject is all
 I could find.:
 
 Re: [Mailman-Users] NNTP server for local newsgroups ?

 John Fitzsimons
 Tue, 22 Dec 2009 14:44:10 -0800

 On Mon, 21 Dec 2009 22:13:15 -0500, Barry Warsaw wrote:
  
 On Dec 21, 2009, at 7:36 PM, John Fitzsimons wrote:

 Hi Barry,

 In another thread we were talking about Mailman to web forum
 options. As Mailman can manage NNTP I wondered whether anyone
 here had come across an NNTP server for local (not usenet)
 newsgroups ?
 
 Yes.  I intend to explore using Twisted in Mailman 3 to provide NNTP  
 and IMAP access to Mailman archives.
 
 My question is - would this (hopefully? please!?) also include posting
 support from a newsreader, so that nntp users could also interact with
 the list discussion(s) using their preferred newsreader? Or was this for
 reading only?
 
 Thanks,
 
 Charles
___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] MySQL adaptor - storing in a remote database -ping times

2010-08-12 Thread Mark Sapiro
Aaron Kreider wrote:

  I'm using the MySQL adaptor and am wondering whether it is acceptable 
to have the database in a remote location with a 30 ms ping time between 
it and the server that runs mailman? We'd be running medium sized lists 
of 100-300 subscribers.  It depends on whether the MySQL adaptor will do 
a couple queries to send out an email, or if it does a query for every 
single subscriber (in which case a ping time of 30 ms is unacceptable).


The CalcRecips.py handler does the following:

recips = [mlist.getMemberCPAddress(m)
  for m in mlist.getRegularMemberKeys()
  if mlist.getDeliveryStatus(m) == ENABLED]

This means that it calls getRegularMemberKeys() which results in one
database query to get the addresses of all regular members, and then
for each regular member, it calls getDeliveryStatus() and then for
each regular member with delivery enabled, it calls
getMemberCPAddress().

There is some caching within MysqlMemberships.py, which I think results
in the call to getDeliveryStatus() doing a database query for all
attributes and caching the result, so the call to getMemberCPAddress()
is essentially free, but there is still a query for each regular
member.

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Exporting member info (including options)

2010-08-12 Thread Mark Sapiro
Aaron Kreider wrote:

  Is there a good way to export all of the member info for a list?

I want all the mailing list options as well as the email address, so 
that I can import it into MySQL and use the MySQL adaptor.


There is a script at
http://www.msapiro.net/scripts/mailman-subscribers.py (mirrored at
http://fog.ccsf.cc.ca.us/~msapiro/scripts/mailman-subscribers.py)
that will do this by screen scraping the web admin Membership List
pages, but if I were doing it, I would just create a withlist script
to do it.

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Exporting member info (including options)

2010-08-12 Thread Bob Puff

 Aaron Kreider wrote:
 
   Is there a good way to export all of the member info for a list?
 
 I want all the mailing list options as well as the email address, so 
 that I can import it into MySQL and use the MySQL adaptor.
 
 There is a script at
 http://www.msapiro.net/scripts/mailman-subscribers.py (mirrored at
 http://fog.ccsf.cc.ca.us/~msapiro/scripts/mailman-subscribers.py)
 that will do this by screen scraping the web admin Membership List
 pages, but if I were doing it, I would just create a withlist script
 to do it.

I thought when you kicked in the mysql adaptor, it populated the mysql table
with all that data... you're saying it doesn't, and you have to start from
scratch?

Bob

___
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9