'Behavior of sending email with text and attachment changed in Ubuntu 20.04 for mail from mailutils

In Ubuntu 16.04 I used the following command to send an email with text and attachements, which worked fine.

echo "body" | mail -s "Subject" -A "/path/to/attachment" "email@adress"

In Ubuntu 20.04 this command attaches the body-part as an attachment too. The mail --version is 3.7.

Sending only the attachments or only the body is working fine.

This question is about mail from mailutils not mutt nor mailx nor sendmail, etc. A solution is very very welcome. Thx a lot!



Solution 1:[1]

Thanks a lot to @jhnc for all the information!

This behavior is a bug in mail 3.7 in the package mailutils and adressed in launchpad by 1911894.

But as of today it is unassigned! Not likely to be changed soon.

But Ubuntu 20.04 is a LTS version and sending mail with text and attachements is quite common these days.

If you come along and have the same problem, please fill in a bug report, which is quit easy and helps to increase the importance.

To generate a bug report run in a terminal

apport-cli mailutils

and send it with S to launchpad.

Open browser with 1 and login.

Then enter 1911894 to find the inital bug thread and join. THX!

Solution 2:[2]

Another simple 'solution' is to install the latest mailutils-3.15. This issue is fixed as I verified. Download link: https://mailutils.org/download.html

Solution 3:[3]

Attachement with uuencode works fine with UB20.04

( cat body-message.txt; uuencode input-attachment.txt output-attachment.txt ) \
| mail -s "Email With Body Text and Attachment" ****@gmail.com

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 William Yuan
Solution 3 Suraj Rao