# Configure Google Workspace as a SMTP relay

**URL:** https://meta.discourse.org/t/configure-google-workspace-as-a-smtp-relay/237662
**Category:** Sysadmins
**Tags:** email, how-to
**Created:** [August 31, 2022, 7:49am UTC](https://meta.discourse.org/t/configure-google-workspace-as-a-smtp-relay/237662 "2022-08-31T07:49:12Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![poyrazdursuncan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/poyrazdursuncan/32/204976_2.png) [@poyrazdursuncan](https://meta.discourse.org/u/poyrazdursuncan)
#### Post date: [August 31, 2022, 7:49am UTC](https://meta.discourse.org/t/configure-google-workspace-as-a-smtp-relay/237662/1 "2022-08-31T07:49:12Z")

</div>

# :e_mail:

**1. Purchase the Google Workspace service**

I recommend the Business Standard package. The password of the e-mail account you created will be sent to the account you used when purchasing the package at Google Workspace.

> **[Compare Flexible Pricing Plan Options | Google Workspace](https://workspace.google.com/pricing?hl=en)**
>
> Compare flexible pricing options for Google Workspace with plans for businesses of all sizes.

**2. Configure Google Workspace MX**

| Name/Host/Alias | Time to Live (TTL\*) | Record Type | Priority | Value/Answer/Destination |
| --- | --- | --- | --- | --- |
| @ or leave blank | 3600 | MX | 1 | [ASPMX.L.GOOGLE.COM](http://ASPMX.L.GOOGLE.COM) |
| @ or leave blank | 3600 | MX | 5 | [ALT1.ASPMX.L.GOOGLE.COM](http://ALT1.ASPMX.L.GOOGLE.COM) |
| @ or leave blank | 3600 | MX | 5 | [ALT2.ASPMX.L.GOOGLE.COM](http://ALT2.ASPMX.L.GOOGLE.COM) |
| @ or leave blank | 3600 | MX | 10 | [ALT3.ASPMX.L.GOOGLE.COM](http://ALT3.ASPMX.L.GOOGLE.COM) |
| @ or leave blank | 3600 | MX | 10 | [ALT4.ASPMX.L.GOOGLE.COM](http://ALT4.ASPMX.L.GOOGLE.COM) |

**3. Configure SPF**

Define your SPF record. Create a TXT record:

```plaintext
v=spf1 include:_spf.google.com ~all

```

> **[Set up SPF  |  Apps & integrations  |  Google Workspace Help](https://knowledge.workspace.google.com/admin/security/set-up-spf?visit_id=639159066416354390-4284500535&rd=2)**

**4. Allow less secure apps**

Login in [google admin](https://admin.google.com/) link. Type “Less Secure Apps” in the search box and click on the result. Select the option “Allow users to manage their access to less secure apps”.

Open the “Security” section in the [Google myaccount](https://myaccount.google.com/) link. Turn the “Less secure app access” setting to “On” and turn it on.

**5. Configure DKIM**

Login in [google admin](https://admin.google.com/) link. Type “gmail” in the search box and click on the “Settings for Gmail” option.

Click on the “Authenticate email” section. Apply the TXT record on your domain. It may take up to 48 hours to be active.

**6. Set routing and permissions**

Go back to the “Settings for Gmail” page, click on the “Routing” section.

 ![25d3545d4c98ce6648fe856f1723717886901f34](https://global.discourse-cdn.com/meta/original/4X/8/d/c/8dcf66e0620bd533474a3ebedd0ebf087979274c.png)

**7. Configure your site’s SMTP settings**

```plaintext
nano ./containers/app.yml

```

```plaintext
  DISCOURSE_SMTP_ADDRESS: smtp-relay.gmail.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: hello@domain.com
  DISCOURSE_SMTP_PASSWORD: "password"
  #DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
  DISCOURSE_SMTP_DOMAIN: domain.com
  DISCOURSE_NOTIFICATION_EMAIL: hello@domain.com

```

> **[Send email from a printer, scanner, or app  |  Gmail  |  Google Workspace Help](https://knowledge.workspace.google.com/admin/gmail/send-email-from-a-printer-scanner-or-app?hl=en&visit_id=639158881877626751-1255224532&rd=1)**

**8. Rebuild**

```plaintext
./launcher rebuild app

```

**9. Test email**

It is useful to wait 48 hours after all procedures.

Open the e-mails section from the admin panel and perform the test. You can also use the [mail tester](https://www.mail-tester.com/) site.

---

_[View the full topic](https://meta.discourse.org/t/configure-google-workspace-as-a-smtp-relay/237662)._
