[Mailman-Developers] handler to auto detach attachment and link it to a website keeping html

Sylvain Viart sylvain at opensource-expert.com
Wed Apr 23 07:13:05 CEST 2014


Thanks for your helpful answer. :-)

Sorry it seems I don't have explained my needs correctly:
> On 04/22/2014 03:46 AM, Sylvain Viart wrote:
> List configuration question.
> I need to pass some configuration plugin to this handler. Like remote
> ftp parameters.

I'm looking for a way to handle my own list's parameter, and I quoted 
some /equivalent/ parameter.
Just some chuck of code I would like to implement for my own handler.

I need to set :

mlist.ftp_remote_host = 'ftp.example.com'
mlist.ftp_remote_login = 'somelogin'
mlist.ftp_remote_pass = 'secretstuff'

I can set site global vars in /etc/mailman/mm_cfg.py but how do I set 
local list parameter exactly?
I wont code web interface to handle this, text file config will be great 

> In that case, don't hijack content filtering settings for your own 
> purpose. It won't work. If you are going to hard code some setting for 
> your handler to use, just hard code it in the handler. 

Sorry about this quoting introducing a confusion. No hijack here. No 
hard code neither because if I want to open and share the code, I have 
to remove sensible information from it. Code can embed default 
information, but not the config.

>> Is there some documentation about list configuration override order?
> Not outside the source code. See the __init__ method of the MailList
> class in Mailman/MailList.py. The list's extend.py if any is executed
> before the list's configuration is loaded from disk. Thus any list
> attribute set in extend.py that also exists in the list's saved
> configuration will be overridden by the list config.

And where do I set list configuration? I'm not familiar enough with this 
code to /see/ where it comes from.

Mailman/MailList.py […] mailman 2.1.15

         filename = os.path.join(self.fullpath(), 'extend.py')
         dict = {}
             execfile(filename, dict)
         except IOError, e:
             # Ignore missing files, but log other errors
             if e.errno == errno.ENOENT:
                 syslog('error', 'IOError reading list extension: %s', e)
             func = dict.get('extend')
             if func:
                 func(self)                <==============  run the 
extend() function found in mylists/extend.py
         if lock:
             # This will load the database.
             self.Lock()                  <============== do some more 
stuff possibly overwriting what was done in extend()

There  should be something about bin/config_list I think. Web config 
seems detailed here:

Is there a room for free parameter as well?


More information about the Mailman-Developers mailing list