Red Cricket
Red Cricket

Reputation: 10470

How to avoid sending e-mails that result in "Extra line breaks in this message were removed."

I have a bash script that send an email like so ...

/bin/mailx -s "Unsatisfied dependencies report for the [$lc] YUM repo" [email protected] < /tmp/$prog.output

... when the email arrives to Outlook I get that stupid message about "Extra line breaks in this message were removed". I tried running unix2dos on the /tmp/$prog.output file but that results in the report being sent as binary attachment.

Is there anything I can do from my bash script to prevent the annoying "extra line break in this message were removed" message?

Upvotes: 3

Views: 4428

Answers (2)

TheNewGuy
TheNewGuy

Reputation: 579

In my situation I was able to use awk

echo "$variable" | awk '{ print $0" " }' | mail -s ....

This reads every single line, and re-prints it with three spaces at the end. Outlook is now happy.

https://blog.dhampir.no/content/outlook-removes-extra-line-breaks-from-plain-text-emails-how-to-stop-it

Upvotes: 3

user3288829
user3288829

Reputation: 1275

From the outlook documentation

"By default, the Auto Remove Line Breaks feature in Outlook is enabled. This causes the line breaks to be removed. Any two or more successive line breaks are not removed."

So maybe doubling up your new lines would avoid that.

Upvotes: 3

Related Questions