Can daily output email format be changed?

Status
Not open for further replies.

avpullano

Dabbler
Joined
Dec 30, 2012
Messages
42
I've been enjoying reading through my daily e-mails, but I'm starting to go cross-eyed with the terrible formatting. It seems that the output is e-mailed as plaintext, so all of the spacing gets ruined. I've scoured for a solution but have only found an unanswered bug report from 8 months ago (https://bugs.freenas.org/issues/2210). Is there a solution out there for this? I just want my output to keep its nice columns so I can skim through my datasets more comfortably.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I consider this a Gmail bug. It's plaintext, so it should be rendered with a fixed-width font, but Gmail uses variable-width. There are a number of plugins out there that will fix this for Gmail.

That said, I'm sympathetic to the issue and wouldn't hate to see a solution on the FreeNAS side of things. As the bug suggests, a solution would be to generate an HTML formatted copy of the message that is wrapped in 'pre' tags.
 

avpullano

Dabbler
Joined
Dec 30, 2012
Messages
42
I consider this a Gmail bug. It's plaintext, so it should be rendered with a fixed-width font, but Gmail uses variable-width. There are a number of plugins out there that will fix this for Gmail.

This is a good point and something that I didn't know about Gmail. However, I'm not sure that this is the heart of the problem. The real issue is that the columns do not line up if the information in the first column is not the same length. For example, consider the following lines:


/mnt/RAID1Volume/Media/Music 985G 13G 972G 1% /mnt/RAID1Volume/SystemFiles/dlna_1/media/music
devfs 1.0k 1.0k 0B 100% /mnt/RAID1Volume/SystemFiles/minecraft_jail/dev

See how the columns are misaligned? This repeats for all 35 or so of my datasets, making it pretty difficult to read (especially when Gmail wraps the end of the line, but that has nothing to do with FreeNAS). What I want is some way to get the columns aligned so I can just read the numbers without going cross-eyed.

Do other mail services maintain the columns? Maybe I'm missing something about fixed-width vs variable-width fonts?
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
The point with fixed-width and variable-width fonts is basically that what you want, and what is shown in the "after" image in the ticket you linked, is a rendering with a fixed-width font. A fixed-width font uses the same number of pixels to display an "i" as it does a "w". A variable-width font uses only as many pixels as are needed.

This forum is displayed using variable width, except for code blocks, so consider the following groups of the same number of letters.
iiiiiii
wwwwwww

Code:
iiiiiii
wwwwwww


Essentially, fixed-width fonts preserve the columns as you want. Variable-width doesn't preserve the columns.

Wrapping the daily mails in 'pre' or maybe 'code' html tags would (hopefully) force the use of a fixed-width font.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
The real issue is that the columns do not line up if the information in the first column is not the same length.
If you look at the message source (in Gmail, "Show Original" from the "More" menu), you'll see that the columns do indeed line up. Even though the first columns aren't the same length, there are the correct number of spaces in between the columns to get them to line up. It's Gmail using a variable-width font that causes the columns and spaces to misalign.
 

avpullano

Dabbler
Joined
Dec 30, 2012
Messages
42
Hmm, but in your example you use the same number of i's and w's. I understand that fixed-width font keeps each character the same width, but won't that still leave the issue of the first column of each row being a different length?

Let's test this out:

Code:
/mnt/RAID1Volume/SystemFiles
RAID1Volume/SystemFiles/.warden-template-9.1-RELEASE-amd64              972G    372M    972G    0%    /mnt/RAID1Volume/SystemFiles/.warden-template-9.1-RELEASE-amd64
RAID1Volume/SystemFiles/.warden-template-9.1-RELEASE-amd64-pluginjail    973G    982M    972G    0%    /mnt/RAID1Volume/SystemFiles/.warden-template-9.1-RELEASE-amd64-pluginjail
RAID1Volume/SystemFiles/dlna_1                                          973G    1.6G    972G    0%    /mnt/RAID1Volume/SystemFiles/dlna_1
RAID1Volume/SystemFiles/minecraft_jail                                  974G    2.5G    972G    0%    /mnt/RAID1Volume/SystemFiles/minecraft_jail
RAID1Volume/SystemFiles/owncloud                                        973G    1.1G    972G    0%    /mnt/RAID1Volume/SystemFiles/owncloud
RAID1Volume/SystemFiles/syslog                                          972G    400k    972G    0%    /mnt/RAID1Volume/SystemFiles/syslog
devfs                                                                    1.0k    1.0k      0B  100%    /mnt/RAID1Volume/SystemFiles/dlna_1/dev
procfs                                                                  4.0k    4.0k      0B  100%    /mnt/RAID1Volume/SystemFiles/dlna_1/proc


Yep, you're right. Fixed-width font normalizes the spaces too. You're also right about the "show original" option. Very cool, thank you!

Now I just have to find a way to change how gmail displays the e-mails. At least I'm on the right track, now.
 

avpullano

Dabbler
Joined
Dec 30, 2012
Messages
42
There's no fixed-width plugin for Firefox (my preferred browser), but Thunderbird presents e-mail in fixed-width format. I used to be a big fan of Thunderbird and I've been looking for a reason to try it again, so I'm going to stick with this for a while.
 
Status
Not open for further replies.
Top