Is there a way to read command-line local mail in OS X's Mail application, or another OS X GUI?

4

When I open Terminal it periodically tells me 'You have new mail.', some of which comes from testing web applications that I am running on localhost, which try to send it.

I find the command line mail application impossible to use.

Is there a way to read this mailbox from the OS X Mail application?

joachim

Posted 2010-03-25T07:29:04.653

Reputation: 541

Similar question (although not limited to OS X): http://serverfault.com/questions/126182/front-end-to-linux-std-mailbox-for-development-purposes

– lajuette – 2010-03-25T12:51:39.797

Answers

1

There was an article on macosxhints.com that touched on this subject. Seems like what you're looking for is in there. The other option, if you just want to read the email/delete the email messages and don't really need them to be backed up you can read the /var/mail/$USERNAME file. That file is where those mails are being stored (it's a single text file). If you delete the file you'll stop seeing those alerts showing up in the Terminal.

Matrix Mole

Posted 2010-03-25T07:29:04.653

Reputation: 3 303

This is a very dirty hack. And why must all the old mails be deleted?

Also: If the mbox is deleted the alerts will stop showing - until a new one arrives.

What about adding an mail alias? – lajuette – 2010-03-25T08:09:17.620

The comments on the thread I linked suggests enabling postfix and setting up an alias to direct those emails to another external address. A symlink won't work because Mail.app actually deletes and recreates the mbox file during it's operation (at least according to some stuff I've read). – Matrix Mole – 2010-03-25T08:22:26.977

Hmmm, configuring an MTA can be a little bit dangerous -> open relay. And i think it's overkill for a developer's machine. – lajuette – 2010-03-25T12:34:27.350

I've just tried the macosxhints article.

I'm not sure it's still up to date for 10.6, as Mail.app doesn't seem to be storing its messages in a mbox file: inside the newly-created FOLDERNAME.mbox folder I have a Messages folder, and in that a file with an .emlx extension which seems to be the message I copied over in the instructions. – joachim – 2010-03-26T15:03:27.747

1

If the output is coming from cron jobs, try putting

MAILTO=address@example.com

in the crontab before the lines that interest you

Cebjyre

Posted 2010-03-25T07:29:04.653

Reputation: 180