bsd-mailx's mail(1) has been patched to treat an empty line as an empty body
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bsd-mailx (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bsd-mailx
bsd-mailx 8.1.2-0.
that's a single empty line as a empty body. This causes a warning on
stdout that's impossible to silence through any option, and is broken
behaviour compared to the long-existing mail(1) program on different
Unixes over the years.
$ mail -s test ralph </dev/null
Null message body; hope that's ok
$ echo | mail -s test ralph
Null message body; hope that's ok
$ echo | hd
00000000 0a |.|
00000001
$
The first diagnostic is correct, there was no message body. The second
is wrong, there was a message body, an empty line.
The upstream bsd-mailx does not have this fault. It has been introduced
by the fix to http://
Janus Kristensen, think the bug should have been rejected as it wasn't a
bug but a misunderstanding by the originator. Instead,
bsd-mailx_
+/* check if file is empty or contains only a new line */
+/* Debian Bug#355545 */
+static int fisempty(FILE *mtf)
+{
+ off_t size;
+ char c;
+ if ((size = fsize(mtf)) == 0) return 1;
+ if (size > 1) return 0;
+ fseek(mtf, 0, SEEK_SET);
+ c = fgetc(mtf);
+ fseek(mtf, 0, SEEK_SET);
+ return (c == '\n');
+}
This needs removing and the call to it reverting to the pre-patch
if (fsize(mtf) == 0) {
As it stands, long-term scripts that do `echo | mail ...' in order to
avoid the warning on stdout now fail. It is not them in the wrong, as
is confirmed by package heirloom-mailx's mail(1), and mail(1) on other
Unixes.
Please drop this Debian change.
description: | updated |
Changed in bsd-mailx (Ubuntu): | |
status: | New → Confirmed |
This bug was fixed in the package bsd-mailx - 8.1.2-0. 20131005cvs- 1
--------------- 0.20131005cvs- 1) unstable; urgency=low
bsd-mailx (8.1.2-
* New upstream version from OpenBSD CVS repository. new-line- only-messages- as-empty- ones.patch, introduced 0.20071017cvs- 1 so that bsd-mailx will behave like other mailx confusing- error.patch to make a message given when -b is used
* Remove 23-Treat-
in 1:8.1.2-
implementations and will not treat messages containing a single new line
only as an empty ones (LP: #607099, reopens #355545).
* Extend description of this package to mention the fact that bsd-mailx lacks
many features that may be found in other packages like heirloom-mailx
or mailutils (closes: #508303).
* Add 26-Fix-
without -t less confusing (closes: #327809).
* Fix 00-Makefile.patch not to override CC and pass CPPFLAGS while compiling.
* debian/rules:
+ apply patch from Ubuntu to respect DEB_HOST_GNU_TYPE when selecting CC
for cross-compiling;
+ do not try to run make clean on unpatched Makefile.
* Bump Standards-Version to 3.9.4 (no changes).
-- Robert Luberda <email address hidden> Sun, 06 Oct 2013 11:58:42 +0200