Formatting of file lost when mailed to Outlook from AIX

We use ksh. Our weekly mksysb process outputs to a log file that we have mailed to the admins when ran. We mail it using mailx -s "subject" <email.addy>. The issue is that formatting of line breaks is being lost when the mail is sent. The log file when cat'd on the NIM shows the following:

s# cat test_log
Machine list is:
xx

### Creating NIM mksysb Resource for xx ### Thu Jan 18 10:46:57 CST 2024
Removing oldest file and nim resource: xx_202401181035
New file and nim resource is xx_202401181046
Machine to backup is xx
nim -o define -t mksysb -aserver=master -amk_image=yes -amksysb_flags=e -alocation=/data/images/daily_mksysb/xx/xx_202401181046 -asource=xx xx_202401181046

+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+

Required = 3915666 (3824 MB)    Available = 2580593932 (2520112 MB)



Creating information file (/image.data) for rootvg.

Creating list of files to back up.

Backing up 73200 files.....

73200 of 73200 files (100%)
0512-038 savevg: Backup Completed Successfully.

The email shows the following:

Machine list is: 
xx
 
### Creating NIM mksysb Resource for xx ### Thu Jan 18 10:46:57 CST 2024 Removing oldest file and nim resource: xx_202401181035 New file and nim resource is xx_202401181046 Machine to backup is xx nim -o define -t mksysb -aserver=master -amk_image=yes -amksysb_flags=e -alocation=/data/images/daily_mksysb/xx/xx_202401181046 -asource=xx xx_202401181046

+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+

Required = 3915666 (3824 MB)    Available = 2580593932 (2520112 MB)



Creating information file (/image.data) for rootvg.

Creating list of files to back up.

Backing up 73200 files.....

73200 of 73200 files (100%)
0512-038 savevg: Backup Completed Successfully.

It is noticed that the text from the system (starting at the "+---" line) is unaffected when sent via mail command. Any assistance is appreciated

At first glance, it doesn't necessarily look like a mailx issue, more like input data issue (inconsistent newline character encoding?)
Can you post results of e.g. head test_log | xxd or cat -A test_log | head from the NIM?

As stated, we use korn shell. The first command didn't like the "xxd" so I did the cat command. It failed with the -A stating invalid parameter. I then did the following with output shown:

s# cat test_log | head
Machine list is:
xx

### Creating NIM mksysb Resource for xx ### Thu Jan 18 10:46:57 CST 2024
Removing oldest file and nim resource: xx_202401181035
New file and nim resource is xx_202401181046
Machine to backup is xx
nim -o define -t mksysb -aserver=master -amk_image=yes -amksysb_flags=e -alocation=/data/images/daily_mksysb/xx/xx_202401181046 -asource=xx xx_202401181046

+---------------------------------------------------------------------+

Thanks for assisting.

Well, the xxd is a third-party tool, similar to hexdump (it doesn't have to be installed in your environment), and -A flag to cat command is to show any non-printable characters in a different format (e.g. ^I instead of \t or $ instead of \n, and it should be supported in most GNU/Linux environments).

So the output of just cat test_log | head is:

  1. not related to ksh (or irrelevant to the shell you use), but the lack of -A support in "your cat" command is much more depending on the entire "software stack" you use - what OS, which versions of binaries?
  2. pretty much useless, as it doesn't tell me anything new about the hex/special codes of any newline characters you have issues with.

This NIM is running AIX 7300-02-01-2346. I did some checking and this is the output I think you wanted to see

il084nim2:/tools/NIM_mksysb/mksysb_scripts# cat -vet test_log | head
Machine list is: $
AIX_73$
 $
### Creating NIM mksysb Resource for AIX_73 ### Thu Jan 18 10:46:57 CST 2024$
Removing oldest file and nim resource: AIX_73_202401181035$
New file and nim resource is AIX_73_202401181046$
Machine to backup is AIX_73$
nim -o define -t mksysb -aserver=master -amk_image=yes -amksysb_flags=e -alocation=/data/images/daily_mksysb/AIX_73/AIX_73_202401181046 -asource=AIX_73 AIX_73_202401181046$
$
+---------------------------------------------------------------------+$

The nearest equivalent to xxd or hexdump on AIX is most probably od -t x1a. This should (for example) show a newline as 0A and LF on consecutive lines.

These are all external commands in various distros -- the actual shell in use has no relevance, but AIX will often have different tools to Linux, and variations in the options too.

And
cat -vet
works on all OS.

@Kentlee65,

try mailing to a local address (on the same host) and see if it still messed up.
use the verbose option (-v if available ) and see if that throws any clues ...

check mailx/smtp logs for potential traffic issues/details of size of transmissions ....

also, please confirm the version details for the OS, mailx, ksh (show command output )

can you confirm that the output shown is that verbatim from MS-OUTLOOK (give the Outlook version).

is this a new issue, multiline email been sent to same OUTLOOK service previously ....

etc etc ....

I found the issue, it was in Outlook options. There is a check box under Options > Mail for "Message format" to "Remove extra line breaks in plain text messages"

Thank you all for your input and sorry for the bother.

1 Like

This is what I suspected.
But I have never seen that Outlook removes so many line breaks in a row.
Perhaps it's also advisable to increase the Autowrap to 129, to prevent it from inserting extra line breaks.
There is no possiblitity to completely disable all text reformatting. The algortithm is top secret and will gradually advance towards AI (Artificial Idiocy).

@Kentlee65,

fyi, I asked BARD if uuencoded mail could be automagically uudecoded ... yes it can
Wonder what the behaviour of MSOutlook would do on such an email ... (I have no MS sofware so can't test), might be of interest to see if the uudecoding maintains the structure with the original msoutook settings ...