4

I just installed mutt ('brew install mutt') running as myself (uid=501(john)), no sudo.

It seems to have worked, but now I've got a couple of weird permission problems.

  1. When I run mutt, email always appears new and I can't delete it. When I try, the screen flashes (visual bell, I guess) and I get "Mailbox is read-only". The mailbox appears to be /var/mail/john, and ls gives me this:

    -rw-------  1 john  mail  607 Jun 24 11:25 /var/mail/john
    

    (I'm not in the mail group. Should I be?)

  2. When I run mutt as another user on the system, I get different errors.

    sudo su - conrad
    

    Now my uid (as given by id(1)) is 502 (conrad).

    This time when I run mutt, as before (just plain mutt on the command line), I get slightly different errors:

    /Users/conrad/.mbox: No such file or directory (errno = 2)
    

    (If I supply -f /var/mail/conrad then I go back to case 1.)

    If I use sudo to run mutt, then everything's copacetic, but that doesn't seem right.

How do I fix this?

I guess I'm asking two questions:

  1. How do I fix the file permission issue?
  2. How do I make mutt, when run as another user besides the one that installed it, by default read from /var/mail/*username* instead of /Users/*username*/.mbox?

My software is running the specific versions:

Deimos$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.3
BuildVersion:   14D136

Deimos$ brew info mutt | head -1
mutt: stable 1.5.23 (bottled), HEAD
  • Could you let us know your versions? sw_vers and brew info mutt | head -1 would help us narrow down what you need. This seems to be several issues and questions and you might need some winnowing down to one initial problem. – bmike Jun 24 '15 at 16:24
4

Ok, I still don't know what's going on with the .mbox thing. I suspect that's a mutt/mail config issue of some sort.

BUT... I have a solution for the inability to write /var/mail/username.

http://hints.macworld.com/article.php?story=20100609140550467

dseditgroup -o edit -u john -p -a john -t user mail
dseditgroup -o edit -u john -p -a conrad -t user mail

(john is the admin user)

I added both users in question to the mail group and now both users can use mutt (no command-line arguments) to read their mail spool.

(As an expedient hack to get rid of the visual flag/error message for .mbox, I did:

touch ~/.mbox
chmod go-rwx ~/.mbox

)

  • This works but you will need to open a new shell to fix the read-only issue. – dbkaplun Apr 5 '18 at 23:21
  • FWIW, I did not have to open another shell. This answer worked flawlessly. – alexei Jul 20 '18 at 23:42
0

OK. I'll try to answer both questions and if you need a follow on question to get progress that's fine as well.

  1. Don't su between users to test things that are broken. It's far better to let OS X allow fast user switching and get a real, honest terminal open for the new user to test
  2. All you should need to do is have the user used to set up homebrew allow group read and execute permissions to the programs in /usr/local/bin for a group that contains all the users on the system.

By default, I have /usr/local owned by user 501 and controlled by group admin (80). You could either chown -R 501:staff /usr/local/* or add the users you want to the admin group and keep the homebrew files accessible to admin users.

Worst case, fire up a new user account and tell us what you get when you execute mutt on that user without su - just logging in directly to that account.

  • I'll try that the next time I have physical access to the Mac. – JohnL4 Jun 24 '15 at 17:39
  • Logged on at home. Now both users see the "no .mbox" error, and (still) neither user can access /var/mail/username. Consistency! I'll post what worked for me as an answer. – JohnL4 Jun 25 '15 at 15:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .