1

I'm using altermime with postfix so I can include signatures for each email address with the "-o content_filter" option in /etc/postfix/master.cf for smtpd.

The HTML signature is correctly sent when the emails are sent in HTML format by the client (with some bold text, etc.), but the HTML tags are displayed "raw" when the email is sent as plain text (only text). I know I can configure plain text signatures as well but my preferred option is to always send an HTML version with the company logo.

How to force the "plain text" emails to be converted into HTML emails so the HTML signature could be added/displayed correctly for receivers ? Is there any postfix option for this? I could not find in the documentation...

Thank you,

4
  • 1
    Before you commit to such acts of unnecessary cruelty, understand why people prefer to send plain text mail in the first place. Commented Dec 9, 2024 at 19:16
  • I understand but it's for the needs of a company, for the corporate identity... Commented Dec 9, 2024 at 20:16
  • And that is why many companies force users to configure their own email client/account with a signature rather than configure it at the server end. It may also screw up things if the email was signed or encrypted. Commented Dec 10, 2024 at 14:09
  • You're right about end-to-end encryption, but it's not the case here. If I get no answer, I will probably propose to intercept the mail body before signature/altermime, transform it into a multipart type if it's plain text, to get both plain text and HTML, then apply the signature for both versions (the receivers could have the plain text version if they choose to, but never by default). I hoped there was an option for this but maybe not I guess. Commented Dec 11, 2024 at 2:03

1 Answer 1

1

If you were to do it, you would attach another milter/filter that tries its best to parse the message and output the modified message, with original text part inserted as preformatted text into a suitable html template.

But you cannot generally change your users messages from their plaintext format. Not just because it is rude to sneakily change instead of police someones messages. But also because doing so would break legitimate use cases. It works for some simple cases (single plain-text part), it can be made to work for some special cases (plain-text part inlining attachments), but other messages just cannot be transformed without information or interoperability losses.

  • What do you do with a message not containing any plain text (but still one or more attachments, plus meaningless preambles/epilogues)?
  • Submitting patches to mailing lists generally does not tolerate html, because any superfluous markup would bar patches from being pulled directly into version control.
  • If a message already had alternate parts, even after transformation of each alternate you cannot match its original (e.g. multi-language) presentation, because zero MUAs get multiple levels of multipart choice right.
  • A message you transform might end up not being forwarded to the correct person, as the association with a service ticket is lost during transformation. One way I saw this manifest was that depending on whether I sent them plain text or html, the response of 3rd parties (with MUAs out of my control) would differ in whether it quoted back the ticket reference.

Instead, you probably want to roll out configuration management for your users mail clients, to have their outgoing messages match your expectations where possible, while still permitting use cases where html just won't do.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.