Re: [Mailman-Users] 'Dynamic' footer

2014-03-15 Thread Rodti MacLeary

On 13 Mar 2014, at 15:28, Mark Sapiro  wrote:

> For Mailman 2.1, the Mailman/Handlers/Decorate.py module (called by
> SMTPDirect.py during outgoing message processing) augments the
> replacement dictionary for headers and footers from a 'decoration-data'
> dictionary in the messages metadata if it exists.

Thanks Barry, Mark and Christian for these suggestions.  I’ll try them out this 
weekend :-)

r.
--
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/archive%40jab.org


Re: [Mailman-Users] 'Dynamic' footer

2014-03-13 Thread Mark Sapiro
On 03/13/2014 02:40 AM, Rodti MacLeary wrote:
> 
> While I appreciate that the Mailman tags available to the footer can be
> useful for adding list admin info etc into the footer, it would be nice
> to be able to inject scripted or dynamic content in there.  Even if the
> footer could be persuaded to read a text file (like the other template
> files) then that text file could be updated.


For Mailman 2.1, the Mailman/Handlers/Decorate.py module (called by
SMTPDirect.py during outgoing message processing) augments the
replacement dictionary for headers and footers from a 'decoration-data'
dictionary in the messages metadata if it exists.

Thus, you can create a custom handler (see
) and insert it in the pipeline before
ToOutgoing to make the appropriate dictionary and add it to the metadata.

E.g., it could do something like

... build dynamic_content ...
msgdata.decoration-data = {'mystuff': dynamic_content}

Then, a %(mystuff)s replacement in the footer would be replaced by the
dynamic content built by the custom handler.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter 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/archive%40jab.org


Re: [Mailman-Users] 'Dynamic' footer

2014-03-13 Thread Mailman Admin
Hello Rodti MacLeary

Am 2014-03-13 10:40, schrieb Rodti MacLeary:
> 
> I've trawled the archives and found a variety of questions asking how
> dynamic content might be added to Mailman message footers, but no real
> answers.
> 
> While I appreciate that the Mailman tags available to the footer can be
> useful for adding list admin info etc into the footer, it would be nice
> to be able to inject scripted or dynamic content in there.  Even if the
> footer could be persuaded to read a text file (like the other template
> files) then that text file could be updated.
> 
> If there's no current solution or workaround to this is it something
> that could be considered for Mailman 3?
> 

You could use
bin/config_list -i text_file.txt yourlist
for the corresponding list.
You would have to provide your text file in mailman config syntax to
this command.

So something like this in the text file text_file.txt would work:

msg_footer = """Some Text to put at the footer.
With multiple lines.
And with tags like %(host_name)s."""
digest_footer = """Some Text to put at the digest footer.
With multiple lines.
And with tags like %(host_name)s."""


This also works for headers.


Kind regards,
Christian Mack
--
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/archive%40jab.org


Re: [Mailman-Users] 'Dynamic' footer

2014-03-13 Thread Barry Warsaw
On Mar 13, 2014, at 09:40 AM, Rodti MacLeary wrote:

>If there's no current solution or workaround to this is it something that
>could be considered for Mailman 3?

This is planned for Mailman 3, and most of the infrastructure is there.  The
one bit that's missing is the ability to interpolate custom data into a custom
footer (we can handle retrieving a custom footer).

I've thought about how to handle the retrieval of data, but just haven't
gotten around to implementing it yet.  My thoughts would be to do an HTTP GET
call and require that to return JSON key/value data.

-Barry
--
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/archive%40jab.org


[Mailman-Users] 'Dynamic' footer

2014-03-13 Thread Rodti MacLeary

Hi there,

I've trawled the archives and found a variety of questions asking how 
dynamic content might be added to Mailman message footers, but no real 
answers.


While I appreciate that the Mailman tags available to the footer can be 
useful for adding list admin info etc into the footer, it would be nice 
to be able to inject scripted or dynamic content in there.  Even if the 
footer could be persuaded to read a text file (like the other template 
files) then that text file could be updated.


If there's no current solution or workaround to this is it something 
that could be considered for Mailman 3?


Many thanks!

r.
--
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/archive%40jab.org