Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

mailx

The mail/mailx client in Yosemite doesn't support -a (attachments). (How old is it??) Can I upgrade it to do that, or should I try installing and using something like mutt?


Thanks!

Bob

Posted on Aug 19, 2015 1:22 PM

Reply
10 replies

Aug 19, 2015 3:04 PM in response to NMBob

Bob,


Try the following:

  1. Write your mail message in a file (e.g. messagefile.txt)
  2. UUencode your attachment(s) as follows:

    uuencode -m -o original.b64 original.txt filename_when_decoded.txt

  3. Concatenate: cat messagefile.txt original.b64 > MSG
  4. mailx -s "Test" youremail at isp.com < MSG


If this doesn't do what you want, you can install mutt via homebrew as brew install mutt. I even noticed an old soldier on OS X by the name of xmh.

Aug 19, 2015 3:18 PM in response to VikingOSX

Thanks for the suggestion, but mailx is being called from a Python program, so just a one-liner with little chance of a goofup is best. MH!? That broke a few cob-webs. Holy smokes.


I noticed that the man page for mail/mailx is from Feb 2004. I know there was a mailx security notice in Debian-land for their mailx version last year. I wonder... I hope there isn't anything else in the command line area with "problems".


Why would Apple let these programs get so old? It's a shame.

Aug 19, 2015 5:54 PM in response to NMBob

Why would Apple let these programs get so old? It's a shame.

In some cases it is because the open source software changed to GPLv3 which is so restrictive that should Apple include just 1 GPLv3 in their installation, they would have had to open source every other component in the installation.


Apple has either stopped updating a given open source component to its GPLv2 version, or if was important enough (Samba replacement), then started developing their own.


NOTE: I do not know what license mailx uses, so the above may not apply to mailx.

Aug 20, 2015 6:19 AM in response to VikingOSX

So I did a little digging at

http://www.opensource.apple.com/source/mail_cmds/mail_cmds-30/mail/

and I'm guessing mailx is a UC Berkley license.


ThusApple could make changes. So in this case NMBob can wonder why Apple would neglect this program. Then again, the Unix command line interface has never been Apple's focus. If it is needed for the overall Mac platform/environment, then they work on it. If the in house developers need it, they improve it. Otherwise, they tend to just ignore it, or at least that is my observation.


The key Unix programs I really need, I keep updated with my own builds stored in /usr/local/bin, or via a package manager that will put them other places, such as /opt/local/... bash and Vim mostly, but Apple does keep Vim updated, as its license is not restrictive. Bash has gone GPLv3, so if you want a newer bash, you have to get your own.


I provide my own Vim and Bash for Mac OS X, Solaris SPARC, Solaris X64, AIX, and Linux so I have a consistent behavior. I get my Mac OS X Vim from the MacVim project, but all the rest are compiled from sources. Vim and Bash are were I spend most of my keyboard time at work.


If I recall, I used mailx on OSF/1 back in my DEC days, when I wasn't using the xmh UA. Maybe it is now an HP license.

I used mailx as my main mail client until HP threw me out of ZKO3-3 in 2004. Since then I've been using Thunderbird for work email and just using the gmail web interface for personal mail.

May 24, 2016 9:36 AM in response to NMBob

This problem went away last year (with the server changing to Linux), but just came up again. Ended up going with homebrew and installing mutt. Call me lazy. 🙂


Tried the uuencode route for a bit this morning, but was missing the "link" that tells the email client that there is an encoded section, so it was just showing the uuencoded text. I used to know all of that stuff. Sigh.


VikingOSX: Don't see them wrapped in Python.


No, what I have is a Python program that Popen's a shell to use mail/mutt.


Thanks all!


Bob

mailx

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.