NMBob

Q: 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

Close

Q: mailx

  • All replies
  • Helpful answers

  • by BobHarris,

    BobHarris BobHarris Aug 19, 2015 2:05 PM in response to NMBob
    Level 6 (19,272 points)
    Mac OS X
    Aug 19, 2015 2:05 PM in response to NMBob

    If you want to get an open source package, you can install anything you want.

     

    You could look at HomeBrew

    <http://brew.sh>

     

    There are older package managers, such a Fink and MacPorts

  • by NMBob,

    NMBob NMBob Aug 19, 2015 2:12 PM in response to BobHarris
    Level 1 (44 points)
    Aug 19, 2015 2:12 PM in response to BobHarris

    Sounds good. I wasn't sure if "the dark side" (the GUI part) used mail for anything or not. I'll see if I can find the source. Thanks!

  • by VikingOSX,

    VikingOSX VikingOSX Aug 19, 2015 3:04 PM in response to NMBob
    Level 7 (20,591 points)
    Mac OS X
    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:
      1. 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.

  • by NMBob,

    NMBob NMBob Aug 19, 2015 3:18 PM in response to VikingOSX
    Level 1 (44 points)
    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.

  • by VikingOSX,

    VikingOSX VikingOSX Aug 19, 2015 3:36 PM in response to NMBob
    Level 7 (20,591 points)
    Mac OS X
    Aug 19, 2015 3:36 PM in response to NMBob

    GUI fixation. The majority of OS X users wouldn't know the command line if it hissed first, and then bit them. The /usr/bin/mail and /usr/bin/mailx applications are Mach-O 64-bit executables. Don't see them wrapped in Python.

  • by BobHarris,

    BobHarris BobHarris Aug 19, 2015 5:54 PM in response to NMBob
    Level 6 (19,272 points)
    Mac OS X
    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.

  • by VikingOSX,

    VikingOSX VikingOSX Aug 19, 2015 7:45 PM in response to BobHarris
    Level 7 (20,591 points)
    Mac OS X
    Aug 19, 2015 7:45 PM in response to BobHarris

    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.

  • by BobHarris,

    BobHarris BobHarris Aug 20, 2015 6:19 AM in response to VikingOSX
    Level 6 (19,272 points)
    Mac OS X
    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 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.

  • by VikingOSX,

    VikingOSX VikingOSX Aug 20, 2015 7:04 AM in response to BobHarris
    Level 7 (20,591 points)
    Mac OS X
    Aug 20, 2015 7:04 AM in response to BobHarris

    Bob,

     

    I see in this article that mailx was written for System V Release 3 and was a derivative of UCB Mail.

  • by NMBob,

    NMBob NMBob May 24, 2016 9:36 AM in response to NMBob
    Level 1 (44 points)
    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