Public bug reported: This is working:
echo "test - you should see this in mail body!" | mail -s "mail without attachment test" somebody@mail.domain If I add an attachment the body is always empty: echo "test - you should see this in mail body!" | mail --content- filename="file.txt" --content-type="text/plain" --attach="/path/to/file/file.txt" -s "mail attachment test" somebody@mail.domain I found an old bug for debian already reporting this but it should be fixed in mailutils (1:3.5-3) unstable; urgency=medium . * Cherry-pick patch from upstream git to avoid discarding stdin when mail is used to send email with attachments (closes: #918806). https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918806 So this looks like a regression. The workaround from the debian bug report above using command option --mime is not working and still sending an empty mail body: echo "test - you should see this in mail body!" | mail --mime --content- filename="file.txt" --attach="/path/to/file/file.txt" -s "mail attachment test" somebody@mail.domain I recognized the bug in Ubuntu 20.04 mailutils 1:3.7-2.1 and in current Ubuntu 20.10 with mailutils 1:3.9-3.2 ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: mailutils 1:3.7-2.1 ProcVersionSignature: Ubuntu 5.4.0-56.62-generic 5.4.73 Uname: Linux 5.4.0-56-generic x86_64 ApportVersion: 2.20.11-0ubuntu27.14 Architecture: amd64 CasperMD5CheckResult: skip Date: Fri Jan 15 11:05:17 2021 ProcEnviron: TERM=xterm-256color PATH=(custom, no user) XDG_RUNTIME_DIR=<set> LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: mailutils UpgradeStatus: Upgraded to focal on 2020-05-22 (237 days ago) ** Affects: mailutils (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug focal uec-images -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1911894 Title: mail tool ignores body text from stdin if attachment is added To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/mailutils/+bug/1911894/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs