Hallo.
Hilko Bengen wrote:
|* Bas Zoetekouw:
|> s-nail/heirloom-mailx is not a proper alternative for mailx/bsd-mailx,
|> as it uses different command line options (for example on a regulair
|> mailx, -a means "add header, whereas for s-nail it means "add
|> attachment").
|
|We had some discussion about whether to provide a mailx alternative back
|in the day when heirloom-mailx was still called nail, see #272256.
|
|And at one time there was even a report about a missing -a option
|although it seems that then the submitter decided otherwise, see #381575
|
|> This breaks other packages (for example cron-apt) that rely on a
|> mailx-dependency to send mails. Therefore, I'm making this Serious
|> severity.
|
|The -a option was added to bsd-mailx by Debian more than 16 years ago.
|However, there does not seem to be any clear definition that tells us
|what to expect from a /usr/bin/mailx program.
|
|Is this really s-nail's fault?
|
|Steffen, would you consider changing the parameter for adding an
|attachment to something else?
Rather not, Gunnar Ritter introduced -a already in the first
release of (then) nail, v9.0.0, 21st of March 2000. Even if not,
-a and attachments smells more sane than -a and header additions..
And also the -a of that patched bsd-mailx seems to be used for
faking MIME headers -- one of my occasional Google searches
regarding S-nail presented a bug report in Debian or Ubuntu that
matches this report here --, and that is pretty useless for
nail/mailx since that handles MIME itself.
Cron-apt, hm. Ok, that not. Terrible thing :). Tja. It is
possible to differentiate with a check:
?64[steffen@wales nail.git]$ mail -V
v14.8.14
?0[steffen@wales nail.git]$ echo|MAILRC=/dev/null mail -n#
At EOF
?0[steffen@wales nail.git]$ echo|MAILRC=/dev/null heirloom-mailx -n#
heirloom-mailx: illegal option -- #
Usage: heirloom-mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s
SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
e.g.
( echo|MAILRC=/dev/null heirloom-mailx -n# ) >/dev/null 2>&1
( echo|MAILRC=/dev/null mail -n# ) >/dev/null 2>&1
Likely that this doesn't really hurt this script that much.
(Does it set MAILRC=/dev/null or use -n? Don't think so.)
For none-MIME header additions (this "a" i realize) we will have
the `customhdr' command and the *customhdr* variable, as used for
sending this message (BlahBlahBlah and OpenPGP headers), which
could be used from the command line with -X (command) or -S
(variable), e.g.,
echo bla|./s-nail -d -X'customhdr jazz funk' -Scustomhdr=ju:hu du@auch
...
s-nail: >>> MTA: /usr/sbin/sendmail, arguments: sendmail -i -- du@auch
s-nail: >>> Date: Mon, 28 Nov 2016 22:22:56 +0100
s-nail: >>> To: du@auch
s-nail: >>> User-Agent: s-nail v14.9.0-pre2-92-gcdbe3e5
s-nail: >>> jazz: funk
s-nail: >>> ju: hu
s-nail: >>>
s-nail: >>> bla
Unfortunately only with v14.9.0 it will be possible to define
rather any header when feeding in via -t, too:
./s-nail -:/ -#d -t hey@you >> MTA: /usr/sbin/sendmail, arguments: sendmail -i -- hey@you
s-nail: >>> Date: Mon, 28 Nov 2016 22:43:04 +0100
s-nail: >>> From: hey
s-nail: >>> To: hey@you
s-nail: >>> User-Agent: s-nail v14.9.0-pre2-92-gcdbe3e5
s-nail: >>> X-Curs: diet
s-nail: >>> X-Tea: Chinese
s-nail: >>>
s-nail: >>> Body.
s-nail: >>> More Body.
Sorry.
I'm afraid we don't have that many command line options available
for use, but -a i think it cannot be.
Ciao.
--steffen