mj1.at Michael Jaros' Techblog

25Feb/150

How to send personal HTML newsletters with Mailman

Mailman is a popular open-source mailing list server with a lot of features including automatic bounce handling. There is some documentation on how to set up Mailman for one-way mailing lists suitable for newsletters. But is it even possible to (ab)use this great piece of software for typical marketing newsletters (HTML, recipient's name as part of the message)?

The answer is: Not out of the box. Mailman has functionality called personalization. This allows to include certain "personal" fields in the message header and footer added to the body by Mailman. You can insert special python conversion specifiers including %(user_name)s for the recipient's full name. Unfortunately, field substitution is only supported for headers and footers, which are always plain text message parts. When sending an HTML message (which is mandatory for marketing newsletters), plain text parts wrapped around the formatted message will not look great in most e-mail clients.

The obvious solution would be to allow field substitution in the original message body too. The reason why this trivial improvement has not been integrated into Mailman so far is that it is not a general solution: It will not work for every possible kind of message body, and the sender being able to supply python format strings might impose a security risk, so use this patch only on a mailman installation with controlled and moderated one-way lists.

My debian package version is 1:2.1.13-5. The file to patch is /usr/lib/mailman/Mailman/Handlers/Decorate.py.

Posted by mj

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

Trackbacks are disabled.