Gmail and Microsoft 365
Revoking mailbox access safely: Gmail and Microsoft 365
By mailers.io team Published 5 min read
public/media/blog-revoke-mailbox-access-safely-cover.webp There are good reasons to cut a mailbox off: someone leaves the company, a mailbox is moved to another tool, an old test connection is still lying around, or you simply do not trust a device any more. Doing it carelessly can leave a token alive or stop a running campaign. This post gives the order that avoids both, for Gmail and for Microsoft 365, and explains what happens when access is revoked from the provider’s side.
What “access” actually is
When you connect a Gmail or Microsoft 365 mailbox, mailers.io holds a refresh token, stored encrypted. It is the key that lets the app obtain short-lived access tokens when it needs to send. There is no password. Revoking access means making that refresh token stop working, or deleting it, or both.
Three parties can do that: you in mailers.io, the mailbox owner at Google or Microsoft, and, for Microsoft, a tenant admin. The steps differ a little between the two providers.
Disconnecting on purpose: the order
- Check what is running. Open the campaigns and sequences that use the mailbox. A sequence with the mailbox as one of its senders keeps trying to use it until it is out of rotation. Pause what you can, or make sure another server will take over.
- Disable the server. In Sending, then Servers, switch the server off. It leaves the rotation at once, and mail for it moves to your other servers. If it is the only server, mail waits until you connect another one, so do that first.
- Delete the server when you are sure you will not need it. For a Gmail server, deleting it queues a call that revokes the refresh token at Google. If the call fails, the queue retries it several times with growing delays.
- Confirm at the provider. Open the list of third-party apps in your Google account, or ask the Microsoft 365 admin to look in Entra under Enterprise applications. Check that the app is gone, and remove it by hand if it is not.
- Change the password if a person left under bad terms. For Google, changing the password invalidates Gmail permissions. For Microsoft, a user’s own password change does not revoke the token, but an admin reset in the admin center does.
Gmail: what revokes the token
A Google refresh token stops working when:
- the user removes the app in the Google account,
- the token is not used for six months,
- the user changes the account password,
- the Google project that owns the app has too many live tokens and the oldest is dropped.
Deleting a Gmail server in mailers.io also asks Google to revoke it. This is the cleanest way, because it does not depend on remembering to visit Google. It is not a reason to skip step 4, since a queued call that fails permanently would leave the token alive.
Microsoft 365: there is no per-token revoke
Microsoft offers no endpoint for revoking a single token in this flow. Deleting a Microsoft server in mailers.io therefore removes the stored token from mailers.io and takes the mailbox out of rotation, but it does not tell Microsoft anything. The grant at Microsoft’s side stays until it is removed there.
That is a tenant admin’s job: in the Entra admin center, under Enterprise applications, open the app and either delete it or remove its granted permissions. Admins can also revoke a user’s sessions or reset the password. After that, the next refresh fails.
If you are a user and not an admin, ask for this explicitly when you offboard a mailbox. A deleted server in mailers.io is not the same as a revoked grant.
When access ends without you doing anything
Sometimes the provider ends access on its own: a password change, an admin action, a Conditional Access rule, a mailbox unused for too long (Google after six months, Microsoft after 90 days). mailers.io finds out the next time it needs a fresh access token, which happens before a send or a connection test.
What it does then is the same for both providers:
- the server is disabled immediately, not after a series of failures,
- the server leaves the rotation and mail waiting for it is handed to your other servers,
- the server’s panel shows that access was revoked,
- an activity record notes that the grant ended.
Nothing is lost in the mailbox. Reconnecting restores sending.
Reconnecting
Open the disabled server and choose Reconnect. mailers.io asks you to confirm with your password (and your two-step code if it is on), then sends you through Google or Microsoft again. Sign in with the mailbox that the server was set up for. When you return, re-enable the server. It joins the rotation again with the limits it had before.
If an admin has blocked the app in the meantime, Reconnect shows the same approval screen as a first connection: for Google Workspace the admin must allow the app, and for Microsoft the admin must approve it again.
Why a second server matters
The sequence above is calm if you have more than one server. The default rule on every plan is round robin with up to three attempts and failover, so a revoked mailbox is skipped and the rest keep sending. With a single mailbox, a revoked connection stops sending completely until you reconnect. That is the single point of failure described in why one provider is a single point of failure, and routing by provider quota and speed limits shows how the rotation reacts when a server drops out.
Offboarding checklist
- Find the sequences and campaigns that use the mailbox.
- Make sure another server is ready.
- Disable, then delete, the server in mailers.io.
- Confirm the app is gone in the Google account, or ask the Entra admin to remove it.
- Reset the password if the situation calls for it.
- Remove any IMAP bounce or reply mailbox that was added for it.
- Note the date and who did it in your own records.
The setup guides, connecting Gmail with OAuth and connecting Microsoft 365 with OAuth, cover the reverse operation.
Questions and answers
Does deleting a server in mailers.io remove Google's access?
For Gmail, yes: removing the server queues a call that revokes the refresh token at Google. It is still worth checking your Google account's list of connected apps.
Does deleting a Microsoft server revoke the app?
No. Microsoft has no per-token revoke for this flow, so a tenant admin removes the app or its permissions in Entra.
What happens to messages waiting for a revoked server?
The server leaves the rotation at once and waiting mail is picked up by your other servers. With no other server, it waits until you reconnect.
Written by the mailers.io team. Published .