[Mailman-Users] I have Google recaptcha V2 working on mailman 2.1.23
I am running mailman version 2.1.23. A while back I configured google’s recaptcha v1 on a mailman server to stop subscription abuse. I used the instructions provided here: https://www.dragonsreach.it/2014/05/03/adding-recaptcha-support-to-mailman/ Google announced that recaptcha v1 will end sometime in March 2018. I could not find any instructions for implementing recaptcha v2 with mailman so I took a deep dive into what was required. I set up a test Ubuntu 16.04 server and figured it out. I have no python programming experience so some aspects of this process do not follow best practices. If any of you are experienced at python programming and you have the time, I would appreciate it if you would provide some guidance on how to improve these instructions. There are two areas that need cleaning up. The first one is how to install requisite python modules so they are all located in one nice neat location. In my instructions below I had to add five sys.path.append statements so python could find the extra python modules. This is sloppy. Second, I do not know how to reference a variable from inside a web page template where the variable is defined in mm_cfg.py. For now I just hard coded it but it’s not elegant. These two question are python issues and not really mailman issues. So, for those of you who are running mailman v 2.1.23 (or something close) and you want to enable Google recaptcha v2, here is what I did: Environment Ubuntu 16.04 Mailman 2.1.23 Python 2.7.12 *** Install prerequisite python modules *** The server I tested with was a basic Ubuntu 16.04 install. I had to manually install the following software: sudo apt-get install python-dnspython sudo apt-get install python-distutils-extra sudo apt-get install python-setuptools sudo apt-get install python-dev sudo apt-get install build-essential sudo apt-get install python-requests Manually install these python modules using the command "python setup.py install" inside the source code directory: orderedmultidict furl recaptcha2 ( available at https://pypi.python.org/pypi/recaptcha2/0.1 ) *** Modify the listinfo.html file located at MAILMAN_HOME/templates/en/listinfo.html (assuming you are using English) *** Locate the tag and add this line above it: Locate the tag and add the following lines below it: Please fill out the following captcha NOTE: Use your own google public key for data-sitekey above. The better way to do this would be to add your public key to mm_cfg.py and reference that variable inside this file. When I have more time I will figure out how to do this and update the directions. *** Add your google recaptcha public and private keys to MAILMAN_HOME/Mailman/mm_cfg.py *** Append them to the end of the file: PUBLIC_KEY = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" PRIVATE_KEY = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" *** Edit the file MAILMAN_HOME/Mailman/Cgi/subscribe.py *** We are going to add three pieces of information to this file: 1) The paths to the additional python modules you installed 2) import commands for two modules and 3) the code to check the recaptcha result. Concerning item 1) I manually appended the location of all the modules using sys.path.append. A better way to do this would be to install the modules in one directory where python can find them. I've never worked with python before so I didn't know how to do this. I will take some time later to figure this out and simplify the install instructions MAYBE. In the file subscribe.py, locate the end of the paragraph that contains all the "from Mailman import" commands. In version 2.1.23 this is line 34. After line 34 add all the paths to the extra modules. Here is what I had for my Ubuntu 16.04 server: sys.path.append("/usr/local/lib/python2.7/dist-packages/recaptcha2-0.1-py2.7.egg") sys.path.append("/usr/lib/python2.7/dist-packages") sys.path.append("/usr/local/lib/python2.7/dist-packages/furl-1.0.1-py2.7.egg") sys.path.append("/usr/local/lib/python2.7/dist-packages/orderedmultidict-0.7.11-py2.7.egg") sys.path.append("/usr/lib/python2.7/dist-packages/requests-2.9.1.egg-info") Concerning item 2) immediately after the sys.path.append lines you just added, add these import commands: import requests import recaptcha2 Concerning item 3) this is the last step. Locate the line that reads "# Was an attempt made to subscribe the list to itself?" This should be somewhere around line 188 assuming you've added the above lines already. Directly above this line add the following code: # Google recaptcha v2 captcha_result = recaptcha2.verify( mm_cfg.SECRET_KEY, cgidata.getvalue('g-recaptcha-response', ""), os.environ.get('REMOTE_ADDR') ) if not captcha_result['success']: results.append(_('Invalid captcha')) That’s all. I have tested this in a development environment and it appears to work as expected. -- Mailman-Users mailin
[Mailman-Users] Cleaning up Mailman log files
Does Mailman need to be stopped before cleaning up the log files or can I just "cat /dev/null > error" -- We've Got Your Name @ www.mail.com!!! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
Re: [Mailman-Users] Some Mail Lists not receiving messages
> - Original Message - > From: "Jim Coberly" <[EMAIL PROTECTED]> > To: Mailman-users@python.org > Subject: [Mailman-Users] Some Mail Lists not receiving messages > Date: Thu, 06 Sep 2007 11:51:40 -0600 > > > We have MailMan version 2.1.5 Running on CentOS release 4.3 (Final) > (sorry, I don't know the install method) MTA sendmail-8.13.1-3. > > We have a previously working list that has as members other lists > (a list of lists if you will) which I will call LIST. We recently > discovered the messages to the LIST were delivered to some member > lists and not to others. The LIST has delivered properly in the > past. > > We worked through the steps on Mailman FAQ 4.78. Troubleshooting: > No mail going out to lists members and did not find anything to > explain the problem. > > We have now discovered that e-mails directly the a member list also > do not deliver. > > What else can we check or read to help determine the cause of this problem? Do you have syslog set up so that you are logging mail.debug to a maillog file? The information in maillog will tell you exactly what's happening with your mail delivery... what's being delivered and what isn't and why. This would be the most helpful thing to check at this point. If you aren't syslogging the mail stuff you should start immediately. It's invaluable for troubleshooting. -- We've Got Your Name @ www.mail.com!!! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
Re: [Mailman-Users] Another twist on Error: Unknown virtual host
> VIRTUAL_HOSTS = { 'lists.mydomain.org': 'lists.mydomain.org' } > > This is a little different than the examples in the FAQs because > the domain names for the URLs and the email should be the same in > our case, we don't want to remove the "lists" part. Can someone > tell me if this is the proper way to resolve our "Unknown virtual > host" problem? This worked... in cases like mine you have to be sure not to use the add_virtualhost command but instead edit the mm_cfg.py file by hand. -- We've Got Your Name @ www.mail.com!!! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
[Mailman-Users] Another twist on Error: Unknown virtual host
I'm getting the error "Error: Unknown virtual host lists.mydomain.org" when creating a list through the web interface. I have located several FAQs on this problem but I have a question on syntax when entering a new line in mm_cfg.py. Here's the background information: The CNAME for our list server is lists.mydomain.org but the actual servername is hamm.mydomain.org. All references to our list server should be using lists.mydomain.org both email and web URLs. We DO NOT use any URLs with www prepended to them. I have found and read several FAQs concerning this problem but the FAQs assume the web URLs have www prepended to them. One FAQ even states that when you run the add_virtualhost command it removes the first part of the domain name, the www part before saving the virtual domain name. We don't want that because we don't use www in our URLs to access the web interface. We only have one host, lists.mydomain.org, which I don't consider it to be a virtual host, it's just the main host, period. I've added these two lines to our mm_cfg.py so mailman will think it's lists.mydomain.org: DEFAULT_URL_HOST = 'lists.mydomain.org' DEFAULT_EMAIL_HOST = 'lists.mydomain.org' I was going to add this line to mm_cfg.py to fix the "Virtual host" problem: VIRTUAL_HOSTS = { 'lists.mydomain.org': 'lists.mydomain.org' } This is a little different than the examples in the FAQs because the domain names for the URLs and the email should be the same in our case, we don't want to remove the "lists" part. Can someone tell me if this is the proper way to resolve our "Unknown virtual host" problem? -- We've Got Your Name @ www.mail.com!!! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
Re: [Mailman-Users] Aliases file and upgrading
> 1) Is there any problem with manually adding the extra alias > owner-listname for each migrated list and > 2) Is is possible that mailman 2.1.9 is generating references to > owner-listname and if so, is that a problem? I just found the answer to question 1. If you add the alias manually it will be removed when you run mailman's genaliases command. I'm going to look at postfix's virtual aliasing capabilities to see if I can solve this. -- We've Got Your Name at http://www.mail.com ! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
[Mailman-Users] Aliases file and upgrading
Just tried to upgrade by migrating our lists from mailman 1.0 to mailman 2.1.9 on new hardware. Pre-upgrade testing worked fine but after the real migration I saw a lot of "user unknown" errors in postfix's maillog.After investigating I found a lot of rejected mail destined for owner-listname. I compared the list aliases from the old and new mailman installs and discovered the old version generated an alias in the format owner-listname and listname-owner but the new mailman only generates listname-owner. My first thought was to add the additional alias to each migrated list to catch these emails. However, I also decided I might need to determine where these emails are coming from; maybe not. They either came from the old mailman system and for whatever reason, were delayed and subsequently delivered to the new server. Or, the new mailman server generated them because of some setting that was migrated from the old server. I'm not concerned about the first scenario but I'd like to know if the second scenario is possible. I'd like to find the answer to these two questions: 1) Is there any problem with manually adding the extra alias owner-listname for each migrated list and 2) Is is possible that mailman 2.1.9 is generating references to owner-listname and if so, is that a problem? -- We've Got Your Name at http://www.mail.com ! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
Re: [Mailman-Users] Migrating from 1.0 to 2.1.9
> > Looks like I jumped to a conclusion on the dumpdb script. The > > mailman/bin directory on the old server does not contain a dumpdb > > script however, I just realized that it may be due to the fact > > that someone may have deleted it and not that there was no such > > script for Mailman 1.0. Will a dumpdb script from a newer > > version of Mailman work on the old 1.0 version? > > > It appears there was no dumpdb in Mailman 1.0 or 1.1. There is one in > Mailman 2.0, but I don't know it it will work. You could try it. > > However, even Mailman 1.0 has a withlist which might be useful. > > Here are some other thoughts. > > There's no way to convert the list admin and moderator passwords. See > the 2.1.9 change_pw for why and what to do about it. > > There's code in Mailman/versions.py that goes back to 1.0. Instead of > creating new lists in the new installation, you could try just moving > the old lists//config.db, at least for one test to see what > happens. It might work. It won't solve the password problem, but if it > works, it should save you a bunch of work. > > -- > Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers, > San Francisco Bay Area, Californiabetter use your sense - B. Dylan I moved the config.db file from a test list to the new server. I logged in to the web interface and all the members were there and the settings looked good. Moving the archives over and rebuilding them even worked. However, if I try to run dumpdb on the newly migrated list I get this error: NameError: global name 'DumperSwitchboard' is not defined Although there are other posts in the mailman-users archives where people saw this problem; there was no resolution. So it seems that even though the list appears to function properly and the web intercase works, something is not quite right with the config.db file and Mailman version 2.1.9. It makes me a little nervous to run the migrated lists in production knowing that I can never run dumpdb and I don't know what else might be broken. I think I will go with my original plan of pre-creating each list on the new server, importing the list member's email addresses and manually setting up the list. With 150 lists, I think I can do it in a week. I'd like to try the transfer of config data programatically using withlist but I can't seem to find any comprehensive documentation on the use this command. There are lots of posts in the archives and on google concerning specific uses of the command but no comprehensive usage instructions in one place. I'll keep searching. -- We've Got Your Name at http://www.mail.com! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
Re: [Mailman-Users] Migrating from 1.0 to 2.1.9
> - Original Message - > From: [EMAIL PROTECTED] > To: mailman-users@python.org > Subject: [Mailman-Users] Migrating from 1.0 to 2.1.9 > Date: Mon, 30 Jul 2007 14:35:24 -0700 > > > I've inherited another ancient Mailman 1.0 server running Solaris > 7. I have built a new Solaris 10 box to replace it. I'm not even > going to attempt upgrading this thing. I plan on doing the > following: > > 1) Create the same lists on the new server > 2) Export the users from the old lists > 3) Import the users into the new lists > 4) Copy the listname.mbox files from the old server to the new server > 5) Run "bin/cleanarch listname" and "bin/arch --wipe listname" to > regenerate each list archive > 6) Manually set the list password and security settings for each list > > My question is this; Since Mailman 1.0 does not appear to have a > dumpdb command, how can I get a dump of the list config for each > Mailman 1.0 list? I'm trying to figure out a way to minimize the > manual work associated with step 6. Looks like I jumped to a conclusion on the dumpdb script. The mailman/bin directory on the old server does not contain a dumpdb script however, I just realized that it may be due to the fact that someone may have deleted it and not that there was no such script for Mailman 1.0. Will a dumpdb script from a newer version of Mailman work on the old 1.0 version? -- We've Got Your Name at http://www.mail.com! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
[Mailman-Users] Migrating from 1.0 to 2.1.9
I've inherited another ancient Mailman 1.0 server running Solaris 7. I have built a new Solaris 10 box to replace it. I'm not even going to attempt upgrading this thing. I plan on doing the following: 1) Create the same lists on the new server 2) Export the users from the old lists 3) Import the users into the new lists 4) Copy the listname.mbox files from the old server to the new server 5) Run "bin/cleanarch listname" and "bin/arch --wipe listname" to regenerate each list archive 6) Manually set the list password and security settings for each list My question is this; Since Mailman 1.0 does not appear to have a dumpdb command, how can I get a dump of the list config for each Mailman 1.0 list? I'm trying to figure out a way to minimize the manual work associated with step 6. -- We've Got Your Name at http://www.mail.com! Get a FREE E-mail Account Today - Choose From 100+ Domains -- Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp