Score:0

Message body not sending using mailx

jp flag

I've just upgraded a 16.04 LTS machine to 18.04 LTS. Since doing that a script has not been sending emails in the same way. It pipes the message body to mailx and also attaches a file. The original script had the following:

cat <<EOF | /usr/bin/mailx -s "$HOSTNAME Server Update" -a $LOGFILE $RECIP
This is the output from the safe-upgrade on $HOSTNAME run on

`date`
EOF

I discovered that the attachment option needed changed to -A so modified that. The email sends and contains the attachment but there is no body text. I tried changing it to this:

echo "This is the output from the safe-upgrade on $HOSTNAME run on `date`" | /usr/bin/mailx -s "$HOSTNAME Server Update" -A $LOGFILE $RECIP

But this made no difference. Any suggestions? Is it just a quirk with the recipient's mail client (Outlook/MS Exchange)?

Thanks

Will avatar
id flag
You can presumably check if it’s the recipient’s email account by sending the same email to yourself and seeing hire it comes out?
Firstbass avatar
jp flag
Thanks Will, but I am the recipient. It's generated from a server and sent to my main mail account.
Firstbass avatar
jp flag
Interestingly, if I remove the attachment the body text appears. Go figure!
Firstbass avatar
jp flag
Looks like it's a confirmed bug, https://bugs.launchpad.net/ubuntu/+source/mailutils/+bug/1838461
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.