Search code examples
emailimapgmail-api

Change IMAP folder size limits using API


On your gmail account settings you can set IMAP folder size limit:
GMAIL IMAP folder size limits

My goal is to select "Do not limit the number of messages in an IMAP folder (default)" option using some kind of API, but there is nothing useful in API documentation.
Is there any other way to turn off this limit?


Solution

  • You can use the Gmail API to do this. Calling the users.settings.updateImap method with maxFolderSize set to 0 will remove the folder limit. Reference doc: https://developers.google.com/gmail/api/v1/reference/users/settings/updateImap