2

On OSX 12.2.1 I am seeing a message that I have mail. But if I type mail I see the following:

mail: /var/mail/Chris: Permission denied

If I list the contents of /var/mail/ I see

chris

i.e. all lower case of Chris. If I do id -un I get

Chris

i.e. it starts with capital C. How do I fix this?

1
  • What is the result of ls -l /var/mail/?hris?
    – nohillside
    Mar 12, 2022 at 8:18

1 Answer 1

1

On a standard installation of macOS, the file system is case-insensitive. This means that /var/mail/Chris and /var/mail/chris refers to the same file. As such there's nothing to fix in that regard.

However, you are left with the first error message stating that permission was denied accessing the file. You can elevate your privileges to super user by using the sudo command (assuming your account is able to do so), and then make sure your user has the necessary permissions for the file. Open Terminal and run commands like this:

sudo chown Chris /var/mail/chris
sudo chmod u+r /var/mail/chris

Now the mail command should succeed in reading the file. If it doesn't you could be running into privacy restrictions. You can fix that by opening System Preferences, click , Security & Privacy, select the Privacy tab, select Full Disk Access in the list on the left, and then add Terminal to the list on the right (and ensure it has a checkmark).

You must log in to answer this question.

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