How to read /var/mail/USER mailbox in Mail.app?

So I have some cronjobs setup (because I haven't figured out to schedule the same cronjobs in launchd) and they send e-mails to /var/mail/USER when there are errors.

I want to be able to read this in Mail.app but from what I have read, since 10.4 mbox files aren't used by Mail.app anymore. Is there a way to do this? Other than importing the mailbox everytime?

MacBook Pro, Mac OS X (10.5.4)

Posted on Aug 31, 2008 11:37 AM

Reply
5 replies

Aug 31, 2008 12:09 PM in response to NP7776

NP7776 wrote:
So I have some cronjobs setup (because I haven't figured out to schedule the same cronjobs in launchd) and they send e-mails to /var/mail/USER when there are errors.

I want to be able to read this in Mail.app but from what I have read, since 10.4 mbox files aren't used by Mail.app anymore. Is there a way to do this? Other than importing the mailbox everytime?

no. you'd have to import it every time. you can change your cron job to use Mail.app instead of CML mail or set up a Mail server (if you know how) and use mail to have cron send mail to a regular email address.

Aug 31, 2008 1:10 PM in response to V.K.

I am using a command line backup tool called dirvish. Because it's a Linux tool and not really designed for OS X, it sometimes has issues with backups. Currently the only way I know is when I open a terminal window and it says "you have new mail" and I find out there were errors.

I am open to alternatives. The best one I have come up with so far is to push the output into a folder and have a folder action on that folder that does something when the file changes.

Aug 31, 2008 1:21 PM in response to NP7776

so what exactly is the command that your cron executes? instead of piping it to mail you can use whatever this command produces inside an apple script to send yourself an email using Mail.app instead of CLM mail.

here is a sample apple script.

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Mail"
launch
set myconent to do shell script "date" -- put your own shell command instead of date in here

set NewOne to make new outgoing message with properties {subject:"whatever you want here", content:mycontent, visible:false}
tell NewOne
make new to recipient at end of to recipients with properties {address:"johndoe@gmail.com"}
end tell
send NewOne
end tell</pre>

Your folder action method should work fine as well. you can use it instead of cron to run that apple script.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to read /var/mail/USER mailbox in Mail.app?

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