SIP blocks read access to the /Users/Library/Bob/Mail folder

I wrote a Python script that iterates over all the "Junk.mbox" folders in my account (/Users/Bob/Library/Mail). My account, Bob, is an admin account. Even if I run my script with sudo, the script fails with a permissions error. I manually checked ALL of the folders (recursively) in /Users/Library/Bob/Mail and they all have read/write access for my account.

I wondered if it was SIP related so I disabled it. And, yes, I can access that folder programmatically with SIP disabled. So I re-enabled SIP and simply copied the contents of /Users/Bob/Library/Mail to ~/tmp. Now my Python script runs without issue when pointing to that folder.

Please tell me that I don't have to disable SIP or copy gigabytes worth of data to another location just to access my own email data.

Any suggestions would be greatly appreciated!

Answered by packagesdev in 781651022

Its not SIP. It's probably just Full Disk Access (FDA).

If you're running your script from Terminal.app, maybe just granting FDA to Terminal.app is enough.

Accepted Answer

Its not SIP. It's probably just Full Disk Access (FDA).

If you're running your script from Terminal.app, maybe just granting FDA to Terminal.app is enough.

@packagesdev, thank you so much! I am 100% certain that I enabled FDA for iTerm2 but it must have been disabled at some point.

Re-enabling FDA for iTerm2 solved the permission problem.

Thanks again!

SIP blocks read access to the /Users/Library/Bob/Mail folder
 
 
Q