On 12/07/17 04:51 PM, Greg Wooledge wrote:
On Wed, Jul 12, 2017 at 03:58:07PM -0400, Gary Dale wrote:
I just spent about an hour with Google trying to fix a bash script that
worked last year. The problem was that it stopped sending attachments.
In the course of my research I found that mail / mailx over the years has
used a variety of flags for attachments but now seems to have dropped the
capability entirely. At one point -a <filename> would attach a file. At
another, mailx adopted -A <filename> to do it. Lately neither program seems
to support attachments.
In jessie, we had bsd-mailx and heirloom-mailx. The latter had -a for
attachments, and was awesome and perfect, and is clearly what you were
using.
For some reason, Debian "replaced" heirloom-mailx with s-nail in stretch,
but they didn't *really* replace it. They left it half-done, with no
mailx symlink, and no mail program either. Then, you could install
bsd-mailx to get the old horrible mailx that doesn't do attachments,
which is obviously what happened here.
On <https://wiki.debian.org/NewInStretch> I suggest manually overriding
the /etc/alternatives/mailx symlink to point to s-nail. If that has any
drawbacks for people formerly using heirloom-mailx, I'm not aware of them.
Except that I don't recall ever having installed bsd-mailx. However I
note that after installing heirloom-mailx, it actually does install
s-nail. The man page for heirloom-mailx brings up the s-nail man page. I
didn't run heirloom-mailx or s-nail before installing heirloom-mailx but
I note the packages page for heirloom-mailx describes it as feature-rich
BSD mail in Jessie, Stretch & Buster. It's just when you look at the
dependencies that you see any change.
Why did the mail / mailx developers drop support for attachments?
I have no idea why they left it half-broken, but apparently
<https://bugs.debian.org/846062> is a big part of the picture. I feel
like the Debian maintainers were being pulled in multiple directions,
with one arm being yanked by the bsd-mailx people and the other being
yanked by the heirloom-mailx people.
Interestingly, as I noted, I saw a lot of online pages touting the -a
(or -A) option for adding attachments in mail / mailx. I note mention in
the s-nail man page that there are some changes to the command line in v15.
P.S. during the upgrade to wheezy, mutt's -a option changed, and now
you have to use -- after the filename. But this seems to be an upstream
change, not a Debian one. I guess upstream mutt devs thought it was
more important to let someone do "-a *.txt" than to maintain backward
compatibility. I've never used a wildcard to attach files to an email,
so I'm not sure where that idea came from, but ... oh well, it's done.
I thought about mutt but it uses a configuration file to specify the
from address. With s-nail I set it from the command line using the -r
option. Been bitten when I forgot to select the correct configuration
and the e-mail seems to come from the wrong organization.