Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

El_Capitan

macrumors member
Original poster
Aug 16, 2015
47
41
I would like to be able to read and send quick emails directly from the terminal. I either get a message no mail for user if I try to read it or go through the process of sending an email but no actual email gets sent.

Any UNIX gurus in here?

Intel Mac mini 2018, MacOS 11.5.2 btw :)
 

Kuzbad

macrumors member
Jun 11, 2009
62
20
Hah, I've used OSX/macOS since 10.1 and I've never tried command line email.

Run the mail command

% mail myemailaddress@gmail.com
Subject: Hello World
This is the message
[[ Press CTRL+D to end the message ]]
EOT
%

It sent and arrived to my gmail just fine. Depending on where you are sending the email, there's a decent chance it is flagged as spam or blocked entirely.

Reading emails is a lot more complicated. Honestly, I would think your best bet would be to install a command line program that can send via authenticated SMTP and read via IMAP. alpine (the successor project to pine). Can't say I've used much commandline email in the last ~20 years!
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,245
4,934
Just did a quick experiment myself, and the old mail/mailx programs probably aren't an option for reading, as they are still built for a *nix solution: mail is in /usr/spool/mail/username file.

Mail.app/Internet Accounts builds up an elaborate folder structure for the emails, with each email stored in their own file. And depending on mail service provider, can be in places that you did not expect. Eg. this is the pathname to my latest Gmail email in my Inbox.

Code:
$HOME/Library/Mail/V8/9D0F41B5-F50E-45AC-B309-C4160DC1397A/[Gmail].mbox/All Mail.mbox/771EC4C4-5AFF-44B2-90D5-72965A53AF79/Data/0/1/Messages/10780.emlx
 
  • Like
Reactions: El_Capitan

Boyd01

Moderator
Staff member
Feb 21, 2012
7,947
4,879
New Jersey Pine Barrens
I used pine for e-mail and vi for text editing on BSD unix in the 1980's and 1990's, also on some other platforms - maybe even early versions of OSX? Still use vi some and would probably be ok with pine (or alpine?), but not very motivated to do that. :)
 

El_Capitan

macrumors member
Original poster
Aug 16, 2015
47
41
Hah, I've used OSX/macOS since 10.1 and I've never tried command line email.

Run the mail command

% mail myemailaddress@gmail.com
Subject: Hello World
This is the message
[[ Press CTRL+D to end the message ]]
EOT
%

It sent and arrived to my gmail just fine. Depending on where you are sending the email, there's a decent chance it is flagged as spam or blocked entirely.

Reading emails is a lot more complicated. Honestly, I would think your best bet would be to install a command line program that can send via authenticated SMTP and read via IMAP. alpine (the successor project to pine). Can't say I've used much commandline email in the last ~20 years!
I've tried the same and as you mentioned - it got blocked for some reason. Is there a way to make it work or is that the EOL so to speak?

I'll have a look at alpine although I'd prefer to make things work as barebones as possible. I must say I have no idea what I'm doing with UNIX. It seems fun and interesting to learn it though.
 

nt5672

macrumors 68040
Jun 30, 2007
3,717
8,117
Midwest USA
You can install any number of email clients using MacPorts (https://www.macports.org)

For example:

aerc
pine
alpine
sup
mutt
himalaya

Minimalist CLI email client, written in Rust. Bringing emails to the terminal is a pain. The aim of Himalaya is to extract the email logic into a simple (yet solid) CLI API that can be used either directly from the terminal or UIs. It gives users more flexibility. Himalaya installs a Vim-based termainal UI by default.

Homepage: https://github.com/soywod/himalaya
 
  • Like
Reactions: El_Capitan

El_Capitan

macrumors member
Original poster
Aug 16, 2015
47
41
So, I've installed alpine via Homebrew. I have sent one email to my gmail account and another one to my iCloud account as a test. Pure text, straight from alpine. Neither went through.

I got the lengthy error message that seems to boil down to this in both cases:

"... this message does not meet IPv6 sending guidelines regarding PTR 550-5.7.1 records and authentication. Please review 550-5.7.1
https://support.google.com/mail/?p=IPv6AuthError for more information 550
5.7.1 . m16si21215060pgl.17 - gsmtp (in reply to end of DATA command) ..."

There's a ton of possible issues listed on that link and I have no idea how to address any one of those. Is there like a common noob oversight when it comes to this? I am totally in over my head here.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.