Extra line breaks appear in email signature

If sending mail as html my signature will be display with extra line breaks or spacing. If the email format is plain text, the signature looks correct. How can I fix this? Example Below

html:

John Doe

Manager

jd@company.com

text:
John Doe
Manager
jd@company.com

If I view the email on k9 or thunderbird I see the extra spacing. However, if I view the email on outlook, it appears correct.

K9 version 6.202 & 6.307
Android 11

leaving aside that i find html email to be an abomination, you’ll need to provide the html source for anyone to give more than a guess on the issue. i will note that m$ isn’t known for html standards compliance, so that something html works (or doesn’t) in a m$ product is not an indication that other renderers are doing something wrong (or right).

Thank you for your reply. The html code is below from a test email. I did discover on Thunderbird, that if I select view > message body as > simple html, the signature displays as I expected it to. This however doesn’t do anything for the K9 inbox on my phone.


------U7WVU2QG4BJ7M0P3Y6FWDVYGFNO3FT
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Test body

John Doe
Manager
555-111-2222
jdoe@Company.com
--

This message (including attachments) may contain information that is privil=
eged, confidential or otherwise protected from disclosure. If you are not t=
he intended recipient, please delete it without further distribution and re=
ply to the sender that you have received the message in error.

------U7WVU2QG4BJ7M0P3Y6FWDVYGFNO3FT
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html><html><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
</head>
<body>
Test body
<div style=3D"white-space: pre-wrap"><br>
John Doe<br>
Manager<br>
555-111-2222<br>
jdoe@Company.com<br>
--<br>
<br>
</div>
This message (including attachments) may contain information that is privil=
eged, confidential or otherwise protected from disclosure. If you are not t=
he intended recipient, please delete it without further distribution and re=
ply to the sender that you have
 received the message in error.
</body>
</html>

------U7WVU2QG4BJ7M0P3Y6FWDVYGFNO3FT--

your markup has some problems. e.g., “3D” strings, some that are spurious and some that should be double quotes. how this renders depends on the allowances a renderer makes. you need to generate your html with a reliable code generator and then take care how you move it between environments so that various characters don’t get encoded. you should actually be able to take the signature code you pasted in, edit it with an ascii editor (e.g., not something like "word"™) to clean things up and then test it by viewing the file directly in a browser.

by the way, the top ~two-thirds of the code that you pasted in is message headers which are unrelated to this issue so you may want to edit that out to make things clearer.

@Albatross2108: Was the message generated by K-9 Mail? Or are you only having display issues in K-9 Mail?

Hi @cketti. Both scenarios are true. I created the original message in K-9 and also viewed it in K-9 (as well as Thunderbird).

Hi @njeyaakili,
I did as you said and pasted the html signature as is into my text editor. I saved the file as test.html and opened it with Firefox. It opened and displayed properly. Does that mean the rendering issue is with K-9?

firefox is accommodating to some of the errors in that markup, but if you clean up some, but not all, of them you’ll get double spacing. i suspect that K-9 is being fairly strict (i.e., standards compliant) in its rendering which is why you’re getting the double spacing. the html in your message is a bit of a mess, where was it created - outlook?

Hi @njeyaakili, This signature was created in K-9

That’s not malformed markup. It’s because the message part is encoded using the quoted-printable encoding.

I changed the way K-9 Mail formats signatures in HTML. This should fix the display issue for new messages. The fix will be included in the next beta version, K-9 Mail 6.309.

Thank you very much!

In my tests the HTML that K-9 Mail generates is fine. Is the following footer text automatically inserted by your outgoing mail server?

This message (including attachments) may contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient, please delete it without further distribution and reply to the sender that you have received the message in error.

Something seems to have modified the HTML that was generated by the app. That seems to have caused the display issue.
Anyway, with the change in K-9 Mail 6.309 a modification like this should be fine and not lead to this particular display issue anymore.

@cketti yes, that footer is automatically added by my email server