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`
EOFI 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 $RECIPBut this made no difference. Any suggestions? Is it just a quirk with the recipient's mail client (Outlook/MS Exchange)?
Thanks
4 Reset to default