[Mailman-Developers] Email body customization for each recipient

Barry Warsaw barry at list.org
Thu May 2 21:32:10 CEST 2013


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


More information about the Mailman-Developers mailing list