Re: [Mailman-Developers] Email body customization for each recipient
On May 02, 2013, at 04:03 PM, Spamm Azz wrote:
I wrote a function in C language that customizes an email body. My target is to integrate this function inside mailman 3 to customize the email for each recipient. To manage an input email is possible inserting an handler, but I don't know how to do the same for an outgoing message.
You'll first have to expose your C function to Python. You can do this by writing an extension module or by providing shell access to your function. That's out of scope for this discussion.
Once you've made your function callable from Python, you'll want to implement an IMailTransportAgentDelivery class that implements a deliver() method that calls your C function. Then in your mailman.cfg, set the [mta]output variale to point to your implementation of that interface.
Take a look at src/mailman/mta/deliver.py for how VERP delivery is done. There may be opportunities to provide better extensibility of this basic functionality without having to rewrite it all. Please provide feedback.
Cheers, -Barry
Thanks for the help. I'm following the Barry's solution. In my maiman.cfg I have the [mta]outgoing variable, I suppose you was referring to this variable.
calls your C function. Then in your mailman.cfg, set the [mta]output
variale to point to your implementation of that interface.
I'll post news when available.
participants (2)
-
Barry Warsaw
-
Spamm Azz