It's in /Users/$USER/Library/Mail/V2/MailData/Accounts.plist as the "CachePolicy" attribute.
CacheAllBodies = checkbox unchecked and CacheAllMessages = checkbox checked.
Didn't look too hard but it looks like you may want to use plistbuddy to write to it. Also noticed on my other Mac that key doesn't exist, even if I toggle the box, so it may be stored elsewhere too. Toggled it on my one Mac that shows it from the plist and it did update the checkbox.
Accounts.plist does not exist in the path. My path goes
/Users/<user>/Library/Mail/V3/MailData/
and then from there my only files listed are:
BackupTOC.plist
DefaultCounts
Envelope Index
Envelope Index-T0x7fd892207a10.tmp.QbM4m6-shm
Envelope Index-T0x7fd892207a10.tmp.QbM4m6-wal
Envelope Index-shm
Envelope Index-wal
ExternalUpdates.storedata
ExternalUpdates.storedata-shm
ExternalUpdates.storedata-wal
FlagMailboxes.plist
RulesActiveState.plist
Signatures
SmartMailboxesLocalProperties.plist
SyncedFilesInfo.plist
SyncedRules.plist
SyncedSmartMailboxes.plist
UnsyncedRules.plist
VIPSenders.plist
If I go up a directory, inside of V3 I have two folders that look like they might be account folders. They're labeled in a way that it looks like a UUID type identifier for each folder. Inside of those folders I have .mbox files. No Accounts.plist file.
I don't have a V2 folder, only a V3. I should mention I'm on El Capitan. Was your test done on a previous OS build?
I ran a sudo find / -name Accounts.plist and nothing came up.
Was anyone able to figure this out yet?
I think the file you are looking for is ~/Library/Accounts/Accounts3.sqllite
How to completely disable downloading attachments that belong to corporate account?