How do programs access ~/Library/Mail under OSX 10.14 (Mojave)
Full Disk Access

Add your application or tool to the Full Disk Access list within System Preferences > Security &amp; Privacy.

This is related to the new macOS Privacy Protections in 10.14, aka Mojave.

If you want programs launched from Terminal to be able to access ~/Library/Mail, you will need to add them to the Full Disk Access list (below). I originally added Terminal and still couldn't access the folder. It turns out that I use iTerm2, and not Terminal. That had to be added also.