Re: [Mailman-Users] control delivery processes
Can anyone please help me to debug the syntax error in mm_cfg.py?
ompi_list = [ 'test-crest', 'osl-test' ] if listname in ompi_list: archive_url = ("http://www.open-mpi.org/community/lists/devel/%s/date.php" % (time.strftime("%Y/%m"))) DEFAULT_MSG_FOOTER = """_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: %(archive_url)s """ % { 'archive_url' : archive_url }
What I wanted here is to apply the new DEFAULT_MSG_FOOTER only for the specific mailing lists. Is there something wrong here?
Regards,
--
- DongInn
On Mar 3, 2014, at 4:59 PM, DongInn Kim dikim@cs.indiana.edu wrote:
Hi Barry,
Yes, that is the normal case. We have used it that way so far. Lately we found that it could be useful if a new mail has a link of the new archive at the bottom of message and it seems to be tricky to implement it because the process order is the opposite.
Don’t you see any benefits of doing this?
Regards,
--
- DongInn
On Mar 3, 2014, at 4:51 PM, Barry S. Finkel bsfinkel@att.net wrote:
On 3/3/2014 3:25 PM, DongInn Kim wrote:
Hi,
Is there a way to send a mail after it is archived and then add the archive link to the new mail?
Currently it seems to be pretty difficult to implement this because all the new mails are delivered first and then mail archives are generated.
As long as I know how mailman sends a mail, I think I can play a little bit further.
Can anyone please help me out?
Regards,
--
- DongInn
It is unclear to me exactly what you want to do. If the list has an archive, then after the posting is processed, that posting appears in the archives, where people can search and view the posting (assuming that they present the correct credentials, if required).
Once a mail message has been sent and it is in the archives, then any subsequent mail message can include the URL to the archived message as a reference.
--Barry Finkel
Mailman-Users mailing list Mailman-Users@python.org 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/dikim%40cs.indiana.edu
On 03/03/2014 04:46 PM, DongInn Kim wrote:
Can anyone please help me to debug the syntax error in mm_cfg.py?
ompi_list = [ 'test-crest', 'osl-test' ] if listname in ompi_list: archive_url = ("http://www.open-mpi.org/community/lists/devel/%s/date.php" % (time.strftime("%Y/%m"))) DEFAULT_MSG_FOOTER = """_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: %(archive_url)s """ % { 'archive_url' : archive_url }
What I wanted here is to apply the new DEFAULT_MSG_FOOTER only for the specific mailing lists. Is there something wrong here?
There are several thinks wrong. At the time mm_cfg.py is imported, the name listname is not defined. This is your syntax error, but beyond that, you have a huge misunderstanding of how to go about what you are trying to do.
DEFAULT_MSG_FOOTER only establishes the default value for a newly created list. What you want is to set the msg_footer attribute for the 'test-crest' and 'osl-test' lists to something like:
"""_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: http://www.open-mpi.org/community/lists/devel/%(time)s/date.php """
And then modify Mailman/Handlers/Decorate.py to import time and augment the replacement dictionary by adding {'time': time.strftime("%Y/%m")}.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi Mark,
Thanks for all your help but I still have a problem with updating foot_msg attribute.
[root@lion Mailman]# grep -n10 time Handlers/Decorate.py 11-# GNU General Public License for more details. 12-# 13-# You should have received a copy of the GNU General Public License 14-# along with this program; if not, write to the Free Software 15-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 16-# USA. 17- 18-"""Decorate a message by sticking the header and footer around it.""" 19- 20-import re 21:import time 22- 23-from types import ListType 24-from email.MIMEText import MIMEText 25- 26-from Mailman import mm_cfg 27-from Mailman import Utils 28-from Mailman import Errors 29-from Mailman.Message import Message 30-from Mailman.i18n import _ 31-from Mailman.SafeDict import SafeDict
221- # blacklist of known bad ones. 222- d = SafeDict({'real_name' : mlist.real_name, 223- 'list_name' : mlist.internal_name(), 224- # For backwards compatibility 225- '_internal_name': mlist.internal_name(), 226- 'host_name' : mlist.host_name, 227- 'web_page_url' : mlist.web_page_url, 228- 'description' : mlist.description, 229- 'info' : mlist.info, 230- 'cgiext' : mm_cfg.CGIEXT, 231: 'time' : time.strftime("%Y/%m"), 232- }) 233- if extradict is not None: 234- d.update(extradict) 235- # Using $-strings? 236- if getattr(mlist, 'use_dollar_strings', 0): 237- template = Utils.to_percent(template) 238- # Interpolate into the template 239- try: 240- text = re.sub(r'(?m)(?
I added the ‘time’ variable to the ‘d’ dictionary in Handlers/Decorate.py as you mentioned but I got the following error: "Warning: The following illegal substitution variables were found in the msg_footer string: time Your list may not operate properly until you correct this problem. "
Is there anything wrong with this?
Regards,
--
- DongInn
On Mar 3, 2014, at 8:14 PM, Mark Sapiro mark@msapiro.net wrote:
On 03/03/2014 04:46 PM, DongInn Kim wrote:
Can anyone please help me to debug the syntax error in mm_cfg.py?
ompi_list = [ 'test-crest', 'osl-test' ] if listname in ompi_list: archive_url = ("http://www.open-mpi.org/community/lists/devel/%s/date.php" % (time.strftime("%Y/%m"))) DEFAULT_MSG_FOOTER = """_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: %(archive_url)s """ % { 'archive_url' : archive_url }
What I wanted here is to apply the new DEFAULT_MSG_FOOTER only for the specific mailing lists. Is there something wrong here?
There are several thinks wrong. At the time mm_cfg.py is imported, the name listname is not defined. This is your syntax error, but beyond that, you have a huge misunderstanding of how to go about what you are trying to do.
DEFAULT_MSG_FOOTER only establishes the default value for a newly created list. What you want is to set the msg_footer attribute for the 'test-crest' and 'osl-test' lists to something like:
"""_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: http://www.open-mpi.org/community/lists/devel/%(time)s/date.php """
And then modify Mailman/Handlers/Decorate.py to import time and augment the replacement dictionary by adding {'time': time.strftime("%Y/%m")}.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Users mailing list Mailman-Users@python.org 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/dikim%40cs.indiana.edu
On 03/03/2014 05:29 PM, DongInn Kim wrote:
I added the ‘time’ variable to the ‘d’ dictionary in Handlers/Decorate.py as you mentioned but I got the following error: "Warning: The following illegal substitution variables were found in the msg_footer string: time Your list may not operate properly until you correct this problem. "
Did you restart Mailman after modifying Decorate.py?. If so, the substitution should work despite the warning. If you want to get rid of the warning, you can add 'time' to the ALLOWEDS tuple in Mailman/Gui/Digest.py, but it should work anyway.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Yes, I already restarted mailman when I got the warning message but it did not help. Thanks, your help on Mailman/Gui/Digest.py removed the warning message. The footer message shows up as expected. Thank you again.
Regards,
--
- DongInn
On Mar 3, 2014, at 9:17 PM, Mark Sapiro mark@msapiro.net wrote:
On 03/03/2014 05:29 PM, DongInn Kim wrote:
I added the ‘time’ variable to the ‘d’ dictionary in Handlers/Decorate.py as you mentioned but I got the following error: "Warning: The following illegal substitution variables were found in the msg_footer string: time Your list may not operate properly until you correct this problem. "
Did you restart Mailman after modifying Decorate.py?. If so, the substitution should work despite the warning. If you want to get rid of the warning, you can add 'time' to the ALLOWEDS tuple in Mailman/Gui/Digest.py, but it should work anyway.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
DongInn Kim writes:
Can anyone please help me to debug the syntax error in mm_cfg.py?
ompi_list = [ 'test-crest', 'osl-test' ] if listname in ompi_list: archive_url = ("http://www.open-mpi.org/community/lists/devel/%s/date.php" % (time.strftime("%Y/%m"))) DEFAULT_MSG_FOOTER = """_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: %(archive_url)s """ % { 'archive_url' : archive_url }
What I wanted here is to apply the new DEFAULT_MSG_FOOTER only for the specific mailing lists. Is there something wrong here?
It would help if you report the whole error that you're seeing, or if you're not able to find the error message, precisely what behavior leads you to think something's wrong.
I'm guessing that the problem is that you have a large number of format elements without corresponding values to interpolate in the format string for DEFAULT_MSG_FOOTER. Double all of the '%' characters except that corresponding to archive_url and you'll probably get the result you want.
Hi Stephen,
Thanks for your help.
It would help if you report the whole error that you're seeing, or if you're not able to find the error message, precisely what behavior leads you to think something's wrong. The error message showed up at the log message and any new mails could not go through. Mar 3 19:05:53 lion postfix/local[12378]: 847A5261380: to=test-crest@crest.iu.edu, relay=local, delay=0.14, delays=0.07/0.01/0/0.05, dsn=5.3.0, status=bounced (Command died with status 1: "/opt/mailman-2.1.15/mail/mailman post test-crest". Command output: Traceback (most recent call last): File "/opt/mailman-2.1.15/scripts/post", line 32, in <module> from Mailman import mm_cfg File "/opt/mailman-2.1.15/Mailman/mm_cfg.py", line 88, in <module> if listname in ompi_list: NameError: name 'listname' is not defined )
I'm guessing that the problem is that you have a large number of format elements without corresponding values to interpolate in the format string for DEFAULT_MSG_FOOTER. Double all of the '%' characters except that corresponding to archive_url and you'll probably get the result you wan I am not sure how to do this but Mark Sapiro gave me a good input to fix my problem on this.
Regards,
--
- DongInn
On Mar 4, 2014, at 6:36 AM, Stephen J. Turnbull stephen@xemacs.org wrote:
DongInn Kim writes:
Can anyone please help me to debug the syntax error in mm_cfg.py?
ompi_list = [ 'test-crest', 'osl-test' ] if listname in ompi_list: archive_url = ("http://www.open-mpi.org/community/lists/devel/%s/date.php" % (time.strftime("%Y/%m"))) DEFAULT_MSG_FOOTER = """_______________________________________________ %(real_name)s mailing list %(real_name)s@%(host_name)s subscribe: %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s searchable archives: %(archive_url)s """ % { 'archive_url' : archive_url }
What I wanted here is to apply the new DEFAULT_MSG_FOOTER only for the specific mailing lists. Is there something wrong here?
It would help if you report the whole error that you're seeing, or if you're not able to find the error message, precisely what behavior leads you to think something's wrong.
I'm guessing that the problem is that you have a large number of format elements without corresponding values to interpolate in the format string for DEFAULT_MSG_FOOTER. Double all of the '%' characters except that corresponding to archive_url and you'll probably get the result you want.
Hello All,
My system that serves both email and mailman sits behind a firewall. Email gets forwarded on by a gateway / firewall, and web access comes from a different server machine that sits on the boundary - has access to both networks, internal and external - and users get to mailman's web features through use of an Apache mechanism I can't quite recite to you now. If the user has the correct URL, everything works fine, but the automatically generated web pages and text at header / footer of emails is wrong, and, in particular that of welcome messages for new people.
I have a list I'd like to update and fix this (more than one, possibly, if I get this figured out!) but recreating it with proper attributes won't be easy as it has a bit of archive to it already. So, I thought I'd simply dump the config, edit the output file and re-import the change, but it won't take. On reloading, it always says, "Non-standard property restored: web_page_url". And, indeed, the parameter is NOT changed. Damn.
So, I know about the wonderful tools available here: http://www.msapiro.net/scripts/ I looked and found "set_attributes". Great! But while it spits out a few happy looking lines of text and appears to work at first, it returns the same error:
$ ./set_attributes "web_page_url = 'http://MyDomain.com/mailman/'" myList attribute "web_page_url" changed Non-standard property restored: web_page_url $
-frown-
How am I supposed to do this?
Again, to be most precise, mailman is using the system's own internal network name (which I don't want to / can't change) instead of the external domain name I want it to use. I have not found a standard administrator way of setting this value. Note that it's NOT a virtual name! BOTH email and web server are accessable using the same domain name.
Thanks for any help.
Richard
Hello Everyone,
I have more than once wished I could send out password reminder emails to either individuals or an entire list. However, I haven't found a way to do that yet. How can I do this, please?
Thanks, Richard
On 3/5/2014 1:03 PM, Richard wrote:
Hello Everyone,
I have more than once wished I could send out password reminder emails to either individuals or an entire list. However, I haven't found a way to do that yet. How can I do this, please?
Thanks, Richard
There should be a cron to send password reminders each month. IIRC, each list has an admin setting that determines if that list gets reminders. ALL of my list-creation templates had reminders disabled; I did nothing to disable the cron job. As I wrote to this list on Feb. 28 - when I was running a Mailman installation, I saw no need to send password reminders.
--Barry Finkel
On 03/05/2014 11:03 AM, Richard wrote:
Hello Everyone,
I have more than once wished I could send out password reminder emails to either individuals or an entire list. However, I haven't found a way to do that yet. How can I do this, please?
As Barry F. notes, you can run Mailman's
cron/mailpasswds -l LISTNAME
to send reminders for LISTNAME, but this will only send the reminders for LISTNAME if LISTNAME's send_reminders setting is Yes and will only send them to those members who haven't opted out of reminders via the "Get password reminder email for this list?" setting on their user options page.
To send a reminder to user@example.com, go to a URL like http://mailman.host/mailman/options/LISTNAME/user@example.com and click the Remind button.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Earlier, I wrote:
Hello All,
My system that serves both email and mailman sits behind a firewall. Email gets forwarded on by a gateway / firewall, and web access comes from a different server machine that sits on the boundary - has access to both networks, internal and external - and users get to mailman's web features through use of an Apache mechanism I can't quite recite to you now. If the user has the correct URL, everything works fine, but the automatically generated web pages and text at header / footer of emails is wrong, and, in particular that of welcome messages for new people.
Please note that this is a particular problem for accessing attachments from the archive - the URL is just plain wrong. This is a big deal...
I have a list I'd like to update and fix this (more than one, possibly, if I get this figured out!) but recreating it with proper attributes won't be easy as it has a bit of archive to it already. So, I thought I'd simply dump the config, edit the output file and re-import the change, but it won't take. On reloading, it always says, "Non-standard property restored: web_page_url". And, indeed, the parameter is NOT changed. Damn.
So, I know about the wonderful tools available here: http://www.msapiro.net/scripts/ I looked and found "set_attributes". Great! But while it spits out a few happy looking lines of text and appears to work at first, it returns the same error:
$ ./set_attributes "web_page_url = 'http://MyDomain.com/mailman/'" myList attribute "web_page_url" changed Non-standard property restored: web_page_url $
For what it's worth, I also tried about every version of what a URL might look like - removing 'http://", including on the domain name, etc - nothing sticks. Frustrating!
-frown-
How am I supposed to do this?
Again, to be most precise, mailman is using the system's own internal network name (which I don't want to / can't change) instead of the external domain name I want it to use. I have not found a standard administrator way of setting this value. Note that it's NOT a virtual name! BOTH email and web server are accessable using the same domain name.
Thanks for any help.
Richard
On 03/05/2014 11:21 AM, Richard wrote:
...
Please note that this is a particular problem for accessing attachments from the archive - the URL is just plain wrong. This is a big deal...
...
So, I know about the wonderful tools available here: http://www.msapiro.net/scripts/ I looked and found "set_attributes". Great! But while it spits out a few happy looking lines of text and appears to work at first, it returns the same error:
$ ./set_attributes "web_page_url = 'http://MyDomain.com/mailman/'" myList attribute "web_page_url" changed Non-standard property restored: web_page_url
First of all, config_list will issue that message whenever you set a list attribute that isn't in the web admin GUI, but the message means it 'restored' the attribute to the value you gave, not it's original value. That should work. Why do you think it doesn't?
Second, the preferred tool for changing web_page_url is fix_url.py. See the FAQ at http://wiki.list.org/x/mIA9 and perhaps others that mention fix_url.
Note also that public archive URLs are somewhat different and are based on PUBLIC_ARCHIVE_URL rather than DEFAULT_URL_PATTERN, although the 'hostname' should come from that in web_page_url.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (5)
-
Barry S. Finkel
-
DongInn Kim
-
Mark Sapiro
-
Richard
-
Stephen J. Turnbull