17

I often get e-mails (*1) in HTML format where the lines are longer than the window width of Thunderbird and often even longer than my screen width. In order to read theses messages I have to scroll horizontally all the time.

One Option to make messages readable is to switch View/Message Body to plain text, but that also loses all the formatting. Switching to simple HTML does not help.

Is there any way for me (as the receiver) to force Thunderbird to wrap long lines so that these messages become readable?

I of course googled but found nothing but hints that only worked in the compose window or to tell the senders to stop using broken software. All that is not really helpful.

(*1: from brain dead correspondents using broken mail clients, I know, but there is nothing I can do about this.)

4 Answers 4

9

Luckily Thunderbird is a really expandable client, so a possible solution would be to edit the userContent.css file which allows you to specify custom CSS rules for messages.

Try the following steps:

  1. Go to your Thunderbird profile folder (follow the instructions in the page and select your OS). It should look like this (obviously with a bunch of other files): thunderbird profile dir
  2. Create the chrome directory if it does not exist.
  3. Create inside the chrome folder a file named userContent.css as a plain text file (be sure to show file extensions if necessary, otherwise you may end up with a userContent.css.txt file and it is not what we want)
  4. Edit the file with any text editor (notepad should work too), and put the following line in it:

    * { word-wrap: break-word; }
    
  5. Restart Thunderbird and you should be good to go.

This is a test I did locally, before and after applying the rule:

no rule

As you can see the text is not wrapped and there's the scrollbar you are talking about.

with the rule Now, with the userContent.css applied, the text is wrapped automatically (thus there are no scrollbars) and this looks like it's what you wanted.

3
  • 3
    The userContent.css tip is great, but the CSS you gave didn't work for me. I used the one from this answer: stackoverflow.com/questions/248011/…
    – SPRBRN
    Oct 10, 2014 at 9:33
  • To be more precise, adding a more specific rule, mentioning <pre>, in userContent.css solves the problem.
    – gerlos
    Feb 10, 2015 at 17:48
  • I added only this line to userContent.css and it works for me: pre{white-space: pre-wrap;}
    – Hans
    Jun 23, 2017 at 8:27
6

Complementing Robertof's answer, I used the following userContent.css:

/* Avoid annoyingly long lines */
body {
    max-width: 50em;
}

pre {
    max-width: 50em;
    white-space: pre-wrap;       /* CSS 3 */
}

Using this approach, I feel in perfect control of how messages should be displayed to me.

Place userContent.css into the following folder (creating if necessary):

C:\Users\[username]\AppData\Roaming\Thunderbird\Profiles\[profile name].default\chrome\

2
  • This worked for me, whereas Robertof's solution didn't. Thanks! Aug 2, 2017 at 11:12
  • This should work but it's not working for me, how do I know TB is actually reading this .css file? Mar 22, 2019 at 0:20
2
+25

While viewing the message use the menu option of View / Word wrap within <PRE>, or press Ctrl + Shift + Q :

image

6
  • Thunderbird 31.1.1 on Linux doesn't have this menu item and doesn't respond to the keystroke. Oct 6, 2014 at 15:26
  • @DennisWilliamson: It seems like it now requires an addon : Toggle Word Wrap.
    – harrymc
    Oct 6, 2014 at 17:25
  • The feature only works in FF, not in TB. "In a browser window (Firefox or Seamonkey), checking Word Wrap Within <PRE> in the View menu..." Oct 6, 2014 at 17:59
  • You must be looking in the wrong place, because this is clearly for TB. However, I found out that this addon is pretty useless, since it doesn't work in HTML mode. I also found out that I myself am on TB version 24. I have no idea why TB is not updating automatically, but going by by what you say, I'm not going to upgrade it manually any time soon. Thanks.
    – harrymc
    Oct 6, 2014 at 19:08
  • The quote in my comment is from the link in yours. Oct 6, 2014 at 20:52
0

better is:

/* Avoid annoyingly long lines */
body {
    max-width: 100%;
}
pre {
    max-width: 100%;
    white-space: pre-wrap;       /* CSS 3 */
}

it uses the complete window-width, but does avoid non-wrapped display anyway!

2
  • 1
    Can you expand your answer to explain your specific point? Thanks.
    – fixer1234
    Mar 13, 2015 at 4:29
  • This version did not work for me, although I see the point that a dynamic width setting would be nice. Can we use 100vw here instead?
    – Peter T.
    Aug 3, 2016 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .