Hi,

Seems working… Great.

Le 19/04/2014 20:24, Mark Sapiro a écrit :
You don't have to do that. If xxx is the base64 encoded image data, all
you need is

     clip = MIMEImage(xxx, 'png', _encoder=email.encoders.encode_noop)
     clip['Content-Transfer-Encoding'] = 'base64'

Cool!

The working code I produced is:

from email.mime.image import MIMEImage
from email import encoders
#[…]
    clip = MIMEImage(ATTACH_CLIP, 'png', _encoder=encoders.encode_noop)
    clip['Content-Transfer-Encoding'] = 'base64'
    clip.add_header('Content-ID', '<part1.%s>' % clip_cid)

Thank you. :-)

List configuration question.

I need to pass some configuration plugin to this handler. Like remote ftp parameters. I've seen code like this:

if mlist.convert_html_to_plaintext and mm_cfg.HTML_TO_PLAIN_TEXT_COMMAND:


I suppose that I configure it that way:

/etc/mailman/mm_cfg.py
HTML_TO_PLAIN_TEXT_COMMAND = 'path/to/converter'

and in my extend()

mlist.convert_html_to_plaintext = 1

is in /var/lib/mailman/lists/mytestlist/extend.py  [debian base path]

I took it here http://wiki.list.org/pages/viewpage.action?pageId=4030615. I used extend.py to install my custom handler that way:

import copy
from Mailman import mm_cfg
def extend(mlist):
  mlist.pipeline = copy.copy(mm_cfg.GLOBAL_PIPELINE)
  # The next line inserts MyHandler ahead of Moderate.
  mlist.pipeline.insert(mlist.pipeline.index('Moderate'), 'MyHandler')


Also, it's indicated that there's a kind of caching involved with the Handler's code…:

Note however, that the first time Mailman saves the list, the pipeline attribute will be saved along with it, so simply removing extend.py from lists/test-list/ won't remove the special pipeline.

I do perform a mailman restart to load new handler's code:

/etc/init.d/mailman restart


Is there some documentation about list configuration override order?

I found a topic giving some information for personalizing the list:

4.48 How can I change the HTML (or .txt) templates used by my mailing lists?
http://wiki.list.org/pages/viewpage.action?pageId=4030605


Regards,
Sylvain.
_______________________________________________
Mailman-Developers mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to