October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Send GitLab Email Through Gmail on a Self-Hosted Server

Set up GitLab email through Gmail on a self-hosted Omnibus server, choose mailbox SMTP or Workspace relay, and fix authentication, TLS, sender-policy and quota failures.
Length10 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a self-hosted Omnibus GitLab server, the simplest Gmail setup is mailbox SMTP at smtp.gmail.com on port 587 with STARTTLS and a Google app password. Edit /etc/gitlab/gitlab.rb, run sudo gitlab-ctl reconfigure, then send a test notification. Do not use the normal Google account password.

Use smtp-relay.gmail.com instead when your organization manages Google Workspace and wants centralized policy, sender-domain controls, IP-based authentication, or relay auditing. The two services solve different operational problems; choosing the endpoint that matches your account and Workspace policy prevents most authentication and delivery failures.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the right Gmail SMTP service first

GitLab can submit mail either through an individual Gmail or Google Workspace mailbox, or through the Google Workspace SMTP relay service. Both use SMTP, but their identities, authentication and administrative controls differ.

Decision point Mailbox SMTP Google Workspace relay
Hostname smtp.gmail.com smtp-relay.gmail.com
Typical use One small installation sending as one mailbox Organization-wide server or application relay
Authentication Mailbox credentials with a Google app password; OAuth is the strategic option where supported Workspace relay policy using a registered public IP, SMTP authentication, or both, according to the administrator’s configuration
Common client port 587 with STARTTLS 587 with TLS; Google also documents 25 and 465 for the relay service
Sender control Normally tied to the authenticated mailbox and its permitted aliases Workspace policy can restrict source IPs and sender domains
Administration Managed in the individual Google account Managed centrally in the Google Workspace Admin console
Best fit Personal Gmail or a low-volume, single-project server Managed domains, static egress IPs, several applications, and organizational auditing

A Workspace relay is not simply a faster name for Gmail SMTP. It will reject a server whose source IP, sender domain, or authentication method does not match the relay policy. Conversely, a personal Gmail account generally has no reason to use the relay hostname.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

What you need before editing GitLab

Omnibus GitLab scope

The instructions below target an Omnibus installation whose configuration file is /etc/gitlab/gitlab.rb. You need root or sudo access, a working GitLab installation, outbound network access from the GitLab host, and a way to generate a test notification.

Mailbox SMTP prerequisites

Google requires 2-Step Verification before an app password can be used. Google describes an app password as a 16-digit passcode and explicitly states: “App passwords can only be used with accounts that have 2-Step Verification turned on.” The app-password option can be unavailable for some work or school accounts, accounts enrolled in Advanced Protection, or accounts whose 2-Step Verification is restricted to security keys.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create the app password in the Google account that will send GitLab mail. Treat it as a secret, not as a substitute for your normal sign-in password. If the Google account password is changed, Google revokes existing app passwords; generate a new one and update GitLab in that situation.

Relay prerequisites

For Workspace relay, an administrator must decide whether the server authenticates by registered public source IP, SMTP credentials, or an approved combination. The server’s public IP must be stable if the policy uses IP authentication. The sender domain must be registered and permitted, and the identities presented in HELO/EHLO and MAIL FROM must satisfy the Workspace policy.

Configure GitLab with a Gmail mailbox

Use this method when a single Gmail or Workspace mailbox is the sending identity. The documented GitLab example uses port 587 and upgrades the connection with STARTTLS.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

1. Generate the app password

  1. Sign in to the Google account that will send GitLab notifications.
  2. Turn on 2-Step Verification if it is not already enabled.
  3. Open the account’s app-password management page and create a new passcode for GitLab or another recognizable label.
  4. Copy the generated 16-digit value immediately. Google shows it as a passcode; enter the value without spaces if the account interface displayed spaces for readability.

If the account does not offer app passwords, do not keep guessing credentials. Check whether it is a managed work or school account, Advanced Protection account, or a security-key-only 2-Step Verification setup. Ask the Workspace administrator for an OAuth-capable integration or an approved relay policy instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Edit gitlab.rb

Open the file with an editor that does not expose its contents in shell history:

sudo editor /etc/gitlab/gitlab.rb

Add or update the SMTP settings below. Replace the example address and app password with the real values.

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "APP_PASSWORD"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

The combination is intentional: port 587 starts as a plain SMTP session and then negotiates encryption with STARTTLS, so smtp_enable_starttls_auto is enabled while smtp_tls remains false. Certificate verification is set to peer; do not disable verification to conceal a certificate or interception problem.

GitLab warns that the password must not contain Ruby or YAML string delimiters such as an unescaped single quote. If the generated secret includes a character that conflicts with the quoting style in your file, use a safely escaped Ruby string or generate a replacement app password. Keep the file readable only by administrators and do not commit it to source control.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

3. Apply the configuration

Save the file and reconfigure the Omnibus installation:

sudo gitlab-ctl reconfigure

Chef will render the GitLab mail configuration and restart components as needed. A successful reconfigure does not prove that Google accepted a message; it only proves that GitLab accepted the configuration syntax and applied it.

4. Send a test notification

Trigger a GitLab action that sends an email, such as inviting a test user, requesting a password reset, or changing notification settings for a test account. Use a recipient you control and record the time, sender, recipient and GitLab project or action that generated the message.

If the message does not arrive, check the GitLab Sidekiq and mail-related logs immediately after the test. A message can be queued successfully and fail later when the worker opens the SMTP connection, authenticates, or receives a Google response.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure GitLab through Google Workspace SMTP relay

Choose relay when the organization, rather than one mailbox owner, should control which servers may send. First create the relay rule in Google Workspace Admin according to the organization’s security policy. Select the permitted source IP addresses, authentication requirement, TLS requirement, sender restrictions and allowed ports. Google documents smtp-relay.gmail.com and ports 25, 465 and 587; 587 is the usual choice for a TLS-enabled application connection.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Relay settings GitLab must match

  • Endpoint: Set gitlab_rails['smtp_address'] to smtp-relay.gmail.com, not smtp.gmail.com.
  • Port and encryption: Use the port and TLS requirement selected in the Workspace rule. For a STARTTLS client, port 587 and smtp_enable_starttls_auto = true are typical.
  • Source identity: The public egress IP seen by Google must be one of the IPs registered in the relay policy. A private address from the GitLab host is not sufficient.
  • Sender domain: Configure GitLab’s From and Reply-To addresses with a domain the relay rule permits. The domain in the visible sender, envelope sender and policy should be deliberately aligned.
  • Credentials: If the rule uses SMTP authentication, provide the Workspace-approved username and secret. If it uses IP authentication, do not invent mailbox credentials; configure the relay exactly as the administrator specified.

GitLab’s relay example also sets the GitLab From and Reply-To addresses. Those values matter because a relay may authorize the connection but reject a message whose sender domain is outside policy. Keep the From address stable and monitored; use Reply-To when replies should go to a support or engineering mailbox different from the automated sender.

After changing /etc/gitlab/gitlab.rb, run:

sudo gitlab-ctl reconfigure

Send a controlled test notification and ask the Workspace administrator to check Email Log Search for the same timestamp. This separates a GitLab queueing problem from a Google policy rejection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mailbox SMTP versus Workspace relay: practical trade-offs

Authentication and account ownership

Mailbox SMTP is quick to deploy because one account owns the credential, but that also makes the account a dependency. A password change, account suspension or app-password revocation stops GitLab delivery. Relay moves the decision to Workspace policy and can avoid storing a personal mailbox secret on the server when IP authentication is approved.

Sender-domain control

A mailbox setup is appropriate when every notification should come from one mailbox address or an allowed alias. Relay is better when several GitLab instances or applications must send from a managed organizational domain and administrators need to constrain those senders centrally.

Network assumptions

Mailbox SMTP only requires outbound access to the Gmail endpoint and valid credentials. IP-authenticated relay additionally requires a predictable public egress address. Cloud hosts with changing NAT addresses, multiple egress paths, or restrictive outbound firewalls need an explicit network design before relay will be dependable.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Policy and auditability

Workspace relay provides central controls and Workspace-side event records. That makes it easier to investigate which source sent a message and why Google rejected it. A mailbox remains simpler for a small installation but puts more operational evidence in the Google account and GitLab logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Google’s sending limits and when to change architecture

Google’s published guidance reports a limit of 10,000 recipients per user per day for SMTP relay and a limit of 100 recipients in one SMTP transaction for smtp-relay.gmail.com. These are vendor-published operational limits, not a promise of throughput. A GitLab message addressed to more than 100 recipients must be split into separate transactions when using the relay.

GitLab also warns that Gmail has strict sending limits that can impair functionality as an organization grows. GitLab notifications are event-driven and can spike during incidents, large imports, repository migrations or mass user changes. If your delivery volume is approaching Google’s limits, move the notification workload to a transactional email service designed for application traffic, or redesign notification fan-out before Google begins throttling or deferring messages.

Troubleshoot authentication and delivery failures

“SMTP authentication failed” with smtp.gmail.com

  1. Confirm that the hostname is exactly smtp.gmail.com and the port is 587.
  2. Verify that 2-Step Verification is enabled on the sending account.
  3. Replace the normal account password with a newly generated app password. Do not paste spaces, quotation marks or a trailing newline into the GitLab setting.
  4. Check whether a recent Google account password change revoked the app password. Generate a new one if it did.
  5. Review the Ruby string in gitlab.rb for an unescaped single quote or other delimiter in the secret.
  6. Run sudo gitlab-ctl reconfigure again, trigger a fresh test message, and inspect the worker log rather than relying on an earlier queued job.

“Relay access denied” or sender rejected

  • Confirm that GitLab is using smtp-relay.gmail.com, not the mailbox endpoint.
  • Ask the Workspace administrator to verify the server’s current public IP against the relay rule.
  • Check that the From address and its domain are allowed by the rule.
  • Validate the HELO/EHLO name and MAIL FROM identity if the Workspace error identifies either one.
  • Ensure the selected authentication method matches the rule. An IP-authenticated relay will not be fixed by adding an arbitrary mailbox password, and an SMTP-authenticated rule will not accept an unregistered source.

Connection timeout or TLS errors

  1. Check outbound TCP 587 in the host firewall, cloud security group and network egress policy.
  2. Confirm that a proxy, inspection gateway or NAT device is not interrupting STARTTLS.
  3. For port 587, keep STARTTLS enabled and implicit TLS disabled in the mailbox configuration.
  4. For relay ports 25 or 465, use only the encryption mode required by the Workspace policy and the GitLab version you operate; do not copy the port 587 settings unchanged.
  5. Retest from the GitLab host so the result reflects the server’s actual network path.

GitLab reports success but no one receives the message

Check the GitLab Sidekiq/mail logs for deferred or rejected jobs, then use Google Workspace Email Log Search when the sender is a managed Workspace account. Compare the message timestamp, recipient and sender. Also inspect the recipient’s spam, quarantine and organizational routing rules. A successful SMTP handoff means Google accepted the message for processing; it does not guarantee inbox placement.

Only large notifications fail

Count recipients per SMTP transaction and split any relay submission above 100 recipients. Check the account’s daily recipient total as well. A burst that is individually valid can still be throttled when the per-user or organizational sending budget is exhausted.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Security and maintenance checklist

  • Store the app password or relay credential only in protected GitLab configuration and administrator-managed backups.
  • Keep gitlab.rb out of public repositories, issue attachments and shell history.
  • Use a dedicated sending mailbox rather than a personal administrator account when mailbox SMTP is unavoidable.
  • Restrict the sender address and domain to the minimum required by your notification policy.
  • Keep TLS certificate verification enabled with smtp_openssl_verify_mode = 'peer'.
  • Document who can rotate the credential and how quickly GitLab will be reconfigured after rotation.
  • Monitor Sidekiq/mail errors and Google delivery records, especially after GitLab upgrades, firewall changes or Workspace policy edits.
  • Test password resets and invitation mail, not just one project notification; different GitLab jobs can exercise different queue paths.

Recommended implementation by installation type

Small personal or single-project server

Use a dedicated Gmail or Workspace mailbox with smtp.gmail.com:587, 2-Step Verification and an app password. This minimizes Workspace administration and is usually enough for low notification volume. Set a calendar reminder to review the account and credential lifecycle so a forgotten password change does not silently stop delivery.

Company-managed GitLab with a fixed public egress IP

Prefer smtp-relay.gmail.com when the Workspace administrator can register the egress IP and enforce the sender domain. Relay centralizes policy and gives administrators a clearer audit trail. Confirm the network address will remain stable before selecting IP authentication.

High-volume or burst-heavy GitLab

Do not treat Gmail or Workspace limits as a queueing guarantee. Measure recipients, incident bursts and daily totals. Once application traffic approaches the published limits or delivery latency becomes operationally important, use a transactional mail architecture approved for that volume and keep GitLab’s From and Reply-To identities consistent.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.