Finding out the size of IMAP directories sitting on a mailserver is pretty straightforward in Mail.app. By right-clicking on a mailbox and selecting "Get Account Info" I get a nice overview with a breakdown of how much space each directory is taking on the server. But I can't find a way to get the size of mailboxes that are saved locally ("On my Mac" in the sidebar). Is anyone aware of a way to do that reliably? Bonus points if I can do it over SSH without the end user noticing, but anything works.
Background: I need this because I'm planning to upgrade the storage on our mailserver and upload all our local email archives, and just keep everything in sync over IMAP. All things considered, this looks way cheaper than setting up Backblaze on every laptop. Thus I'd like to estimate how much storage we'll need on the mailserver.