Thursday, May 15. 2008Setting up Mailman to store members in a MySQL databaseTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Some years ago I've implemented the same for a PostgreSQL database. I had problems with correct bounce processing, which I were able to fix. Unfortunately the Mailman developers were not very interested in it, so the patch probably never made it into upstream source.
If you encounter bounce processing problems too, just drop me a line.
I haven't run the thing in production yet so we'll see how that pans out.
I have followed the instructions and it is able to create/modify a table of members, but when a member posts to the list, the other members don't recieve the emails. what can i be missing?
without the addition of the mysqlmemberships file and the extend file, it works just fine.
I am using FC6 and sendmail with mailman.
Anyone have any suggestions?
Perhaps you need to restart the Mailman qrunner? It's hard to diagnose from here...
Thanks for the quick reply!
I found that it asks the moderator for approval because it believes that the message came from a non-user. The email a message comes from IS a user, however, even as seen by mailman's user moderation page. I can update info in the mysql database and mailman will change to reflect that info.
Even after the moderator clicks to accept, however, the message is still not sent.
I will continue playing with it. If you have any further helpful ideas or hints(or even good things to search for on google) I will be happy to check it out!
Thanks again!
There's now an updated version of MysqlMemberAdaptor and a patch for mailman's Bouncer.py that appear to resolve the issues with bounce handling.
Hi
I would like to know more about the Postgre adaptor for mailman? I need it for a mailman project I am working on which needs to abstract the mailman data for postgre database.
Can I take a look at your code?
Hi Thijs,
One line that should also be added to mm_cfg.py:
MYSQL_MEMBER_CREATE_TABLE = "yes"
After that, it works fine for me.
Thanks again!
Ah yes, that is necessary if you use the per-list table and didn't create the table yourself.
I did exactly what you have said and every time I try to log into the list admin page i get an error. Then i remove the extend.py file and everything is fine. what am I doing wrong?
I can't give any useful advice on that when just knowing that you get "an error".
You need to install the MYSQLdb module.
on debian :
# atp-get install python-mysqldb
i have python-mysqldb installed. when i run apt-get install python-mysqldb it says that it is already installed but when i look at the logs it says: admin(3698): import MySQLdb
admin(3698): ImportError: No module named MySQLdb
In the MysqlMemberships.py Insert this:
"
sys.path.append('/var/lib/python-support/python2.5')
"
before this line: import MySQLdb
If you use mysql auth from postfix, insert this to /etc/postfix/main.cf:
"
transport_maps = hash:/etc/postfix/transport
mailman_destination_recipient_limit = 1
"
after, make /etc/postfix/transport content ex:
"
lists.example.com mailman:
"
and command:
postmap transport
!!The postfix+mysql is only work good, if your maillist domain is backup-mx!!
plus: If you do not like create manually the /var/lib/mailman/lists/"listname"/extend.py file, do this:
copy the extend.py to /usr/lib/mailman/Mailman/ and insert line to the /usr/lib/mailman/bin/newlist line 232:
"""before line: msg.send(mlist)"""
os.symlink('/usr/lib/mailman/Mailman/extend.py', os.path.join('/var/lib/mailman/lists/', listname, 'extend.py' ))
"""after line: finally:"""
ps: whitespace is significant in Python ;)
"msg.send(mlist)" is in line 251 and "finally" is in next one. Did you mean _after_ "msg.send" and _before_ "finally"?
I keep getting error "Table 'mylist' already exists" to mailman admin mail. Why's that? My list table exists and there are users inside and everything works like it should. I also see that in msql py script there is query CREATE TABLE IF NOT EXISTS, so this error report doesn't make sense.
Can't get mysqldb module to be recognized. I downloaded from sourceforge (http://sourceforge.net/project/shownotes.php?release_id=491012&group_id=22307) , unpacked and ran install in dir: /usr/local/cpanel/3rdparty/mailman
I am getting these errors from mailman log...
Do I need to install to another directory?
-------------------------------
admin(30098): [----- Mailman Version: 2.1.11.cp3 -----]
admin(30098): [----- Traceback ------]
admin(30098): Traceback (most recent call last):
admin(30098): File "/usr/local/cpanel/3rdparty/mailman/scripts/driver", line 101, in run_main
admin(30098): main()
admin(30098): File "/usr/local/cpanel/3rdparty/mailman/Mailman/Cgi/admin.py", line 71, in main
admin(30098): mlist = MailList.MailList(listname, lock=0)
admin(30098): File "/usr/local/cpanel/3rdparty/mailman/Mailman/MailList.py", line 115, in __init__
admin(30098): execfile(filename, dict)
admin(30098): File "/usr/local/cpanel/3rdparty/mailman/lists/mysqltest_umem.org/extend.py", line 1, in ?
admin(30098): from Mailman.MysqlMemberships import MysqlMemberships
admin(30098): File "/usr/local/cpanel/3rdparty/mailman/Mailman/MysqlMemberships.py", line 46, in ?
admin(30098): import MySQLdb
admin(30098): ImportError: No module named MySQLdb
I've got a similar problem. I also have a cPanel setup.
I noticed that cPanel uses a link to python - so in my setup there are two versions of python (/usr/bin/python and /usr/bin/python2.4). Could this be the problem?
However I have the MySqldb module installed for both and am able to run a simple test script for both that does "import MySqldb".
You need to put : MYSQL_MEMBER_CREATE_TABLE = "yes" before you start using MySQL for Mailman as one already said.
After first visiting "web admin - membership managment" the table for your list in mysql db is created and you need to remove this setting from mm_cfg.py. If you don't do that, you'll get errors I described before: "Table 'mylist' already exists"
I get this error with mailman 2.1.16
Traceback (most recent call last):
File "/var/lib/mailman/bin/list_lists", line 121, in
main()
File "/var/lib/mailman/bin/list_lists", line 94, in main
mlist = MailList.MailList(n, lock=0)
File "/var/lib/mailman/Mailman/MailList.py", line 115, in __init__
execfile(filename, dict)
File "/var/lib/mailman/lists/mysql_test/extend.py", line 2, in
from Mailman.MysqlMemberships import MysqlMemberships
File "/var/lib/mailman/Mailman/MysqlMemberships.py", line 1
^
SyntaxError: invalid syntax
* Site list for mailman missing (looking for list named 'mailman').
* Please create it; until then, mailman will refuse to start.
what's wrong.. I am quite sure I did all the steps.
I have the "import MySQLdb" error.
I have installed it. A simple test script works (it is able to "import MySQLdb"). However mailman gives an error.
I'm on Centos. cPanel.
Hi to everyone,
I've been struggling with running Mailman and MySQL as backend. First of all thanks on the author of this page, I found very few pages with informational content regarding the integration of Mailman and MySQL. I took me half a day to have a running Mailman with MySQL backend so I decided to post short guide how I did it.
First I'm using Debian 5. I have installed the following packages:
postfix, mysql-server, mailman, python-mysqldb.
Postfix and mysql are configured by default. Python-mysqldb is needed for mailman to be able to connect to the mysql database.
The biggest problem I faced was that mailman could not load the MySQLdb module and this took me half a day. It seemed that by some reason mailman don't not use the correct path for loading the modules. What I did is I added the path of the module to the sys.path variable, in the file extend.py:
import sys
if '/var/lib/python-support/python2.5' not in sys.path:
sys.path.append('/var/lib/python-support/python2.5')
When using Debian and installed the binary package python-mysqldb this is the path where the module is installed. If you create a test script and run it from the console it will run without any intervention so that why I think the problem is in the mailman.
The second problem which I faced was that mailman was unable to access the table, error like this one:
admin(8455): ProgrammingError: (1146, "Table 'mailman.list' doesn't exist")
As I saw in the comments (thanks) I had to add one additional parameter to the file mm_cfg.py only for initial creating of the table. So I just added it, access the list info page and then I saw I have a new table created in the database with the name of the list. Then I just commented the parameter.
So these were my problem and now everything seems to work. Thanks for everyone for the comments and hope this helps.
Regards,
Sve
|
QuicksearchBlogroll |