A long-term IMAP storage is legally needed for the spooks to read your email in real-time. With POP they don't have the legal excuses, so they cannot read it. Only what's left over there.
There is an API for that: https://developers.google.com/gmail/api/guides/push#stopping...