Search code examples
google-apps-scriptgmailgmail-api

Gmail limits between consenting gmails


I am using a gmail account to selectively forward incoming mail to the correct recipient based on criteria in the incoming mail. Bear in mind I can't solve this using Gmail filters. I need to run Apps script in order to look up the sender in a database before deciding who to forward the mail to.

I quickly hit a "service invoked too many times" for sending Gmail, which is likely intended to prevent spam mail. However this is not spam and the recipient gmails are consenting and limits are unhelpful here.

Is there any way to remove sending limits between consenting gmails?


Solution

  • You're probably hitting one of the Apps Script quotas. In my experience, Google is unlikely to make exceptions or raise Apps Script limits upon request.

    Most of these quotas are per-account, so a workaround that you could try is to run the script from another account once the limit is reached.

    Also, the limits of the Apps Script Gmail Service are more restrictive than the limits of the pure Gmail API REST calls or other API libraries, so another workaround could be to write the script in another language and use the API, or if you want to keep using Apps Script you can use REST calls rather than the Gmail service.

    Even if you still hit the quotas with the Gmail API there are ways to request a quota increase, while there is no such process for Apps Script. My guess is that Apps Script is intended for smaller projects, but if you're working with a larger volume you're supposed to use the Gmail API instead.