--- Original Message: Wednesday 10 April 2002 08:07 pm ---
Jon,
Can you help me find the reference to the work around as the only post i found(see below) is a post from Greg Stein in 1999 stating that it can't be done but I am hopeful something has been updated.
http://mail.python.org/pipermail/mailman-users/1999-April/001072.html
Thanks, Moshe
Well that's ridiculous! I can think of a work-around right now (without having even glanced at the code).
Find the section of mailman that sends out the Message and add a conditional. Something like, if welcome.<listname>.txt exists welcome.fil = welcome.<listname>.txt else welcome.fil = welcome.txt
Then simply put in a custom welcome file for any list that you want. This works for any of the other files you want to use in Mailman as well.
I'll see if I can find the official work-around. If not, I'll look at the code and see if I can pinpoint it for you quickly.
Jon Carnes
Jon,
Thank you !
As i am just learning Linux/mailman I would appreciate it if you could tell me what file I need to edit. I already fixed the list specific HTML pages but I am unsure where to put that change and would rather not hack without knowing what I am hacking.
Thanks, Moshe
Well that's ridiculous! I can think of a work-around right now (without having even glanced at the code).
Find the section of mailman that sends out the Message and add a conditional. Something like, if welcome.<listname>.txt exists welcome.fil = welcome.<listname>.txt else welcome.fil = welcome.txt
Then simply put in a custom welcome file for any list that you want. This works for any of the other files you want to use in Mailman as well.
I'll see if I can find the official work-around. If not, I'll look at the code and see if I can pinpoint it for you quickly.
Jon Carnes
Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/
Okay, here is the deal...
You can simply change the text in subscribeack.txt and you are done. This changes every welcome message from every list, or
You can edit the file ~mailman/Mailman/Deliverer.py and change the following block of text so that it will check for an existence of an alternative file to 'subscribeack.txt':
# get the text from the template text = Utils.maketext( 'subscribeack.txt', {'real_name' : self.real_name, 'host_name' : self.host_name, 'welcome' : welcome, 'emailaddr' : self.GetListEmail(), 'listinfo_url': self.GetScriptURL('listinfo', absolute=1), 'optionsurl' : self.GetOptionsURL(name, absolute=1), 'password' : password, })
===
The following function added to Deliverer.py may help..."
def specwelcome(listname): """Return special welcome file for `listname' if it exists.""" # If a special subscibeack.txt file exists in the lists home directory # use that instead of the normal one specified in the templates dir welcfile = os.path.join(mm_cfg.LIST_DATA_DIR, listname, 'subscribeack.txt') if not os.path.exists(welcfile): welcfile = "subscribeack.txt" return welcfile
This function looks for a copy of the subscribeack.txt file in the lists home directory (~mailman/lists/<listname>/..). If it finds a copy then it uses that, instead of the common one in ~mailman/templates/... At least, that is what it's supposed to do!
To use it, you would add the function to Deliverer.py and then replace the existing line (in Deliverer.py): 'subscribeack.txt', with something like: specwelcome(name),
===
I'm just hacking code together, so this may or may not hose you. Still its a start. Don't be afraid to play with it and get it working just the way you want! Python is extremely readable code (unlike perl!). Remember to backup any file before you modify it!
Jon Carnes ----- Original Message ----- From: "Mark Moshe Kaye" <jotd2k@yahoo.com> To: <jonc@nc.rr.com> Cc: <mailman-users@python.org> Sent: Thursday, April 11, 2002 9:30 AM Subject: Re: [Mailman-Users] How do I suppress ?
Jon,
Thank you !
As i am just learning Linux/mailman I would appreciate it if you could tell me what file I need to edit. I already fixed the list specific HTML pages but I am unsure where to put that change and would rather not hack without knowing what I am hacking.
Thanks, Moshe
Well that's ridiculous! I can think of a work-around right now (without having even glanced at the code).
Find the section of mailman that sends out the Message and add a conditional. Something like, if welcome.<listname>.txt exists welcome.fil = welcome.<listname>.txt else welcome.fil = welcome.txt
Then simply put in a custom welcome file for any list that you want. This works for any of the other files you want to use in Mailman as well.
I'll see if I can find the official work-around. If not, I'll look at the code and see if I can pinpoint it for you quickly.
Jon Carnes
Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/
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
At 12:28 PM 04/11/2002 -0400, Jon Carnes wrote:
Okay, here is the deal...
- You can simply change the text in subscribeack.txt and you are done. This changes every welcome message from every list, or
[snip]
def specwelcome(listname): """Return special welcome file for `listname' if it exists.""" # If a special subscibeack.txt file exists in the lists home directory # use that instead of the normal one specified in the templates dir welcfile = os.path.join(mm_cfg.LIST_DATA_DIR, listname, 'subscribeack.txt') if not os.path.exists(welcfile): welcfile = "subscribeack.txt" return welcfile
This function looks for a copy of the subscribeack.txt file in the lists home directory (~mailman/lists/<listname>/..). If it finds a copy then it uses that, instead of the common one in ~mailman/templates/... At least, that is what it's supposed to do!
Have you gotten this snippet of code to work? I tried and it bombed, although I know very little about python so I may have done something wrong. I haven't changed the following line yet:
To use it, you would add the function to Deliverer.py and then replace the existing line (in Deliverer.py): 'subscribeack.txt', with something like: specwelcome(name),
Another solution would be to edit subscribeack.txt to include just text that should be sent to *every* list and add your own text to the "list specific text prepended..." box on the general options page. I'm considering doing this to prevent the "to post to the list..." text & accompanying e-mail address from being included in the welcome message for announce only lists. The trick will be remembering to add the necessary text and list address to lists that do accept posts!
-Eric
Eric Sisler <esisler@westminster.lib.co.us> Applications Specialist Westminster Public Library Westminster, CO USA
Linux - Don't fear the Penguin. Want to know what we use Linux for? Visit http://gromit.westminster.lib.co.us/linux
Thanks for testing it! I'll give it a run tonight myself and tweak it. Shouldn't be too hard to make it work, though it might work better if I used a file in the ~mailman/templates/.. directory. It also doesn't need to be a function - I just thought I would get fancy.
It should be easy to play with and get it to work..
I grepped the ~mailman/Mailman/.. dir for subscribeack.txt and found it in the file Deliverer.py. Then I peeked at the code in Deliverer.py and saw that it was a simple import of the text from the file (and then a translation of some dynamic variables from the text).
So I thought of replacing the default filename with a function call and having the function return either the default file name (subscribeack.txt), or a different list specific file name (if it existed).
I hacked it together in email. Never tested it. It's not something I'm likely to use.
I normally don't worry about the welcome message. For my purposes, if it is inappropriate, I don't send a welcome message out.
Jon ----- Original Message ----- From: "Eric Sisler" <esisler@westminster.lib.co.us> To: <mailman-users@python.org> Sent: Thursday, April 11, 2002 2:12 PM Subject: Re: [Mailman-Users] changing the Welcome message on a per list basis... a shot in the dark
At 12:28 PM 04/11/2002 -0400, Jon Carnes wrote:
Okay, here is the deal...
- You can simply change the text in subscribeack.txt and you are done. This changes every welcome message from every list, or
[snip]
def specwelcome(listname): """Return special welcome file for `listname' if it exists.""" # If a special subscibeack.txt file exists in the lists home directory # use that instead of the normal one specified in the templates dir welcfile = os.path.join(mm_cfg.LIST_DATA_DIR, listname, 'subscribeack.txt') if not os.path.exists(welcfile): welcfile = "subscribeack.txt" return welcfile
This function looks for a copy of the subscribeack.txt file in the lists home directory (~mailman/lists/<listname>/..). If it finds a copy then it uses that, instead of the common one in ~mailman/templates/... At least, that is what it's supposed to do!
Have you gotten this snippet of code to work? I tried and it bombed, although I know very little about python so I may have done something wrong. I haven't changed the following line yet:
To use it, you would add the function to Deliverer.py and then replace the existing line (in Deliverer.py): 'subscribeack.txt', with something like: specwelcome(name),
Another solution would be to edit subscribeack.txt to include just text that should be sent to *every* list and add your own text to the "list specific text prepended..." box on the general options page. I'm considering doing this to prevent the "to post to the list..." text & accompanying e-mail address from being included in the welcome message for announce only lists. The trick will be remembering to add the necessary text and list address to lists that do accept posts!
-Eric
Eric Sisler <esisler@westminster.lib.co.us> Applications Specialist Westminster Public Library Westminster, CO USA
Linux - Don't fear the Penguin. Want to know what we use Linux for? Visit http://gromit.westminster.lib.co.us/linux
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
At 03:12 PM 04/11/2002 -0400, Jon Carnes wrote:
Thanks for testing it! I'll give it a run tonight myself and tweak it.
Thanks for the sample code. If I knew more about python I'd try and fix it myself. (Learning python is on my "list of things to do", I just haven't gotten there yet.) It does tend to hose other mailman functionality, so if you don't want to test it on a production mailman box, let me know. I'm in the process of setting up my first list so mailman hasn't gone live yet and I'd be happy to test it.
Shouldn't be too hard to make it work, though it might work better if I used a file in the ~mailman/templates/.. directory. It also doesn't need to be a function - I just thought I would get fancy.
I was thinking ~/mailman/templates/subscribeack.[list-name].txt might be a good location.
I hacked it together in email. Never tested it. It's not something I'm likely to use.
I normally don't worry about the welcome message. For my purposes, if it is inappropriate, I don't send a welcome message out.
Then don't spend a lot of time on it, unless you've nothing better to do. ;-) It'd be nice to have, but I can probably make my earlier suggestion re: short subscribeack.txt file and add the rest to the "list specific text prepended..." box on the general options page. AFAIK, you can't include html tags though, which could be a drawback.
-Eric
Eric Sisler <esisler@westminster.lib.co.us> Applications Specialist Westminster Public Library Westminster, CO USA
Linux - Don't fear the Penguin. Want to know what we use Linux for? Visit http://gromit.westminster.lib.co.us/linux
participants (4)
-
Eric Sisler
-
Jon Carnes
-
Jon Carnes
-
Mark Moshe Kaye