[Mailman-Users] handler to auto detach attachment and link it to a website?
Mark Sapiro
mark at msapiro.net
Sun Apr 13 17:55:05 CEST 2014
On 04/11/2014 02:06 PM, Mark Sapiro wrote:
>>
>> Development question, is there a way to test the handler against a mail
>> content, outside of the full mailman context?
>>
>> Something like:
>>
>> $ python -some-useful-switch-here MyHandler.py < mymail_withheader.txt
>
>
> withlist is the tool for this. When I get a chance, I will update the
> above FAQ with a skeleton framework, but in short you need a withlist
> script that imports your handler, reads your message and builds a
> Mailman.Message.Message object and calls your handler's process function.
I have created a test script at
<http://www.msapiro.net/scripts/test_handler.py> (mirrored at
<http://fog.ccsf.cc.ca.us/~msapiro/scripts/test_handler.py>) which can
be used to unit test your handler against a test list and message and
optional metadata. I also updated the FAQ at
<http://wiki.list.org/x/l4A9> to point to this script.
--
Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
More information about the Mailman-Users
mailing list