Gmail and Google Workspace
Forward a Gmail or Google Workspace mailbox to opendesk and send replies from your address with Google sign-in or Gmail's SMTP server, or connect it over IMAP on your own instance.
A Gmail or Google Workspace mailbox receives by forwarding: Gmail passes incoming mail on to a private opendesk address. Replies go out from your address in one of these ways:
- Google, when your instance offers it. You approve sending once, and replies go out through Gmail and land in your Sent folder. opendesk gets permission to send mail as you and nothing else: it cannot read, change or delete your mail. See Send with Google.
- Gmail’s SMTP server, with an app password. See Send through Gmail’s SMTP server.
- A sending service such as Resend or Postmark, over SMTP, once it has verified your domain. See Send with a sending service.
On your own instance, a mailbox can also send through opendesk, and a Gmail mailbox can be read directly over IMAP. See On your own instance: receive over IMAP.
Send with Google
Section titled “Send with Google”Add the mailbox and pick forwarding
In Settings, open Mailboxes and click Add mailbox. Type a name and the address. opendesk shows Gmail or Google Workspace. Keep Forward mail to opendesk selected and click Continue.
Send replies with Google
Under How replies are sent, keep Connect Google selected and click Continue with Google. Sign in with the Google account for the address. Google asks you to let opendesk send email on your behalf. Approve, and Google sends you back to opendesk with the mailbox connected.
Forward the mail
opendesk shows the private address to forward to. In Gmail, add it as a forwarding address, confirm it with the code that arrives in opendesk as a ticket, and turn forwarding on. Forwarding has the steps. For a Google Group or a shared address, use a routing rule instead.
Send a test email
Write to the address from another account. It shows up in Unassigned as a new ticket, and your reply goes out through Gmail.
What opendesk asks for
Section titled “What opendesk asks for”| Scope | Why |
|---|---|
openid, email |
Identify which Google account was connected. |
https://www.googleapis.com/auth/gmail.send |
Send the replies your team writes, from your address. |
This is send-only access. opendesk cannot read, search, change or delete the mail in your mailbox with it. opendesk requests offline access, so sending keeps working after you close the browser. The refresh token is encrypted at rest with AES-GCM.
How opendesk uses Gmail data
Section titled “How opendesk uses Gmail data”opendesk’s use of information received from Google APIs adheres to the Google API Services User Data Policy, including the Limited Use requirements. Gmail is used only to send the replies your team writes and, on a self-hosted instance that syncs the mailbox, to turn its mail into tickets in your workspace. It is not used for advertising, not sold, and not read by people except as needed for security, to comply with the law, or with your permission for support.
Self-hosting
Section titled “Self-hosting”On your own instance, Google sign-in for mailboxes needs your own Google OAuth client (GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET), and GOOGLE_MAILBOX_OAUTH turns it on or off for new mailboxes. See Google and Microsoft OAuth and Mailbox sign-in.
Send through Gmail’s SMTP server
Section titled “Send through Gmail’s SMTP server”When Google sign-in isn’t offered, replies can still come from your address through Gmail’s SMTP server, signed in with an app password: a 16-letter password Google makes for one app. The account needs 2-Step Verification on, since Google only offers app passwords on accounts that have it.
Turn on 2-Step Verification
Open myaccount.google.com/security while signed in to the address. Find 2-Step Verification under How you sign in to Google and turn it on with a phone prompt, an authenticator app or a text message. If it is already on, continue.
Create an app password
Open myaccount.google.com/apppasswords. Google may ask you to sign in again. Type opendesk as the app name and choose Create, then copy the 16 letters it shows.
No app passwords page? 2-Step Verification is still off, or your Google Workspace admin has turned app passwords off. See Google Workspace notes.
Add the mailbox with your SMTP server
Add the mailbox, choose Forward mail to opendesk, then, under How replies are sent, Your SMTP server. Enter
smtp.gmail.com, port465with TLS, your full address as the username and the app password. opendesk signs in before it saves anything.Forward the mail
Turn on forwarding in Gmail to the address opendesk shows, as in Forwarding.
On your own instance: receive over IMAP
Section titled “On your own instance: receive over IMAP”A self-hosted instance with IMAP receiving on (MAILBOX_IMAP, the default) can also read a Gmail mailbox directly instead of forwarding it, in two ways. opendesk Cloud receives by forwarding.
With an app password
Section titled “With an app password”The wizard’s App password way signs in to Gmail’s IMAP and SMTP servers with an app password, so opendesk reads new mail over IMAP and sends replies through Gmail. It takes about two minutes.
- App password: paste the 16 letters Google shows. Spaces are fine, opendesk removes them.
- Server settings, set for you:
imap.gmail.comon port 993 andsmtp.gmail.comon port 465, both over TLS. - Connect checks the sign-in with Google, then saves the mailbox.
Add the mailbox and pick App password
Add the mailbox and type the address. opendesk shows Gmail or Google Workspace. Click Choose another way, pick App password and click Continue.
Turn on 2-Step Verification
Click Open Google security settings and turn on 2-Step Verification, as above. Then click It’s on, continue.
Create an app password
Click Open app passwords, create one named opendesk and copy the 16 letters. Click I have it, continue.
Paste it and connect
Paste the app password and click Connect. opendesk signs in to Gmail’s IMAP and SMTP servers before it saves anything. When both work, the last step shows Receiving works and Sending works.
With Google sign-in
Section titled “With Google sign-in”With IMAP receiving on, Choose another way also lists Sign in with Google, which syncs the mailbox over IMAP instead of using forwarding. This asks Google for full access to the mailbox (https://mail.google.com/), so opendesk can read new mail over IMAP and send through Gmail. That scope is restricted: your Google OAuth app needs Google’s verification for it, as described in Google and Microsoft OAuth. Choose forwarding to keep the connection send-only.
If Google refuses the password
Section titled “If Google refuses the password”
If Google refuses the password
Section titled “If Google refuses the password”Nothing is saved when Google refuses. The wizard shows the cause and the fix, with Google’s own reply underneath.
| What you see | What to do |
|---|---|
| Google needs an app password (Google says “Application-specific password required”) | The regular account password was used. Create an app password as above and paste it. |
| Google did not accept the app password | Create a new app password while signed in to this exact address, not an alias or a group, and use it. A deleted app password stops working at once. |
| IMAP is turned off in Google | Only when the mailbox receives over IMAP. On Google Workspace, an admin allows IMAP access (see Google Workspace notes). |
| Google wants a browser sign-in first | Google blocked the sign-in as unusual. Sign in to the mailbox once at mail.google.com, confirm any security prompt, then try again. |
A note under the field also warns when what you pasted doesn’t look like a 16-letter app password.
Google Workspace notes
Section titled “Google Workspace notes”On Google Workspace, an admin controls what people can set up. In the Google Admin console:
- Automatic forwarding: under Apps, Google Workspace, Gmail, End User Access, allow automatic forwarding for the organizational unit of the support account. See Forwarding.
- Shared addresses: a Google Group or a routing address can’t sign in or forward on its own. Route its mail with a rule instead, as in Forwarding.
- Sending with Google: if your organization restricts third-party apps, an admin trusts opendesk under Security, Access and data control, API controls, Manage third-party app access.
- 2-Step Verification: under Security, Authentication, 2-step verification, allow users to turn it on. An organization that requires security keys only, or enrols people in Advanced Protection, has no app passwords.
- App passwords: if the app passwords page is missing for a user with 2-Step Verification on, app passwords are turned off for your organization. Ask your admin to allow them for the support account.
- IMAP, only for a mailbox that receives over IMAP: under Apps, Google Workspace, Gmail, End User Access, turn on POP and IMAP access for the organizational unit of the support account.
Disconnect
Section titled “Disconnect”Remove the mailbox in opendesk, under Mailboxes, and turn off forwarding in Gmail so mail stops going to the old address. Then, in your Google Account:
- Google: remove opendesk under Security, Your connections to third-party apps and services.
- App password: delete it at myaccount.google.com/apppasswords. opendesk can no longer sign in.
If you remove access or delete the app password in Google first, the mailbox shows Needs attention until you connect it again.