On 06/18/2018 02:33 AM, Asaf Ohayon wrote:
I understand Mailman 3 doesn't want to support HTML Emails, This is perfectly legitimate, sadly however, This is a requirement of my client, Which is in this case the Ministry of Education of Israel.
Mailman does support HTML email. Just adjust content filtering to not remove HTML and not collapse alternatives.
What Mailman does not support (and which I think is what you want) is the addition of headers and footers either as text/html parts or inserted into text/html message bodies.
The former would be fairly easy. Look at mailman/handlers/decorate.py. If the messages you are decorating are text/html or multipart/alternative or something more complex, the header and footer are going to be separate MIME parts anyway, so where we have
if len(footer) > 0: mimeftr = MIMEText( footer.encode(lcset, errors='replace'), 'plain', lcset) mimeftr['Content-Disposition'] = 'inline' payload.append(mimeftr) if len(header) > 0: mimehdr = MIMEText( header.encode(lcset, errors='replace'), 'plain', lcset) mimehdr['Content-Disposition'] = 'inline' payload.insert(0, mimehdr)
in two different places, just change the 'plain' arguments to 'html' and then the headers and footers will be added as text/html and can include html tags to be rendered.
On the other hand, if what you want is to insert headers and footers at the beginning and end of an existing HTML body part, We will not make Mailman do that because it is very difficult to do it right. This is because just prepending or appending some additional HTML to an existing HTML part gives unpredictable results. You need to actually parse or render the existing HTML to determine how to add your additions and in complex cases even that may not render as you wish in all various MUA renderings.
If you want to try for HTML what decorate does for simple plain text, you can try it and you may find it works for you, but it is way to fragile for a Mailman feature.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan