Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
VGSOURCES
Get listed

DiscoursePATCH 2026.10.15

How to Set Up SMTP Email on a Self-Hosted Discourse Forum

By VGSources Team 9 min read

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

Put Discourse’s SMTP settings in /var/discourse/containers/app.yml, inside the env section, then recreate or rebuild the app container. A typical authenticated submission setup uses your provider’s SMTP hostname, port 587, a mailbox username and password, and STARTTLS. The provider—not Discourse—determines the correct hostname, credentials, sender-domain rules and encryption mode.

This guide covers the Docker-based self-hosted installation, including port 465 implicit TLS, alternate port 2525, sender-address restrictions, applying environment changes and diagnosing failed mail.

As an Amazon Associate I earn from qualifying purchases.

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.

What SMTP does in Discourse

Discourse uses SMTP (Simple Mail Transfer Protocol) to validate new accounts, send notifications, deliver password-reset messages and distribute other forum mail. The Discourse environment template describes the SMTP address as “The SMTP mail server used to validate new accounts and send notifications.” Your forum is an SMTP client: it connects to a relay operated by your mail provider, authenticates if required, submits a message and receives either an acceptance or a rejection.

This article assumes a conventional self-hosted Discourse Docker deployment under /var/discourse. A hosted Discourse service has a different administration model; you would not edit app.yml on that service.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses | Anti UV Ray, For Computers & Gaming, Square Frame, Eyewear for Men and Women
  • 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.

Before you edit app.yml

Collect these values from the current documentation for your SMTP provider:

  • The SMTP hostname, such as smtp.example.com.
  • The submission port and encryption mode. Port 587 with STARTTLS is common, but it is not universal.
  • The SMTP username and password, if the service requires authentication.
  • Any required SMTP domain, sender-domain verification or provider-specific TLS verification setting.
  • A permitted From address. Some services require it to be the same mailbox used to authenticate.

You also need shell access with permission to modify files and operate the Discourse launcher. Back up /var/discourse/containers/app.yml before changing it, and treat the SMTP password as a secret: restrict file access and do not paste it into public support requests.

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

SMTP environment variables Discourse reads

Add the baseline variables under the existing env: mapping. Keep the indentation used by your generated container file; YAML indentation is significant.

Variable Purpose What to enter
DISCOURSE_SMTP_ADDRESS SMTP server hostname The exact hostname supplied by your relay; this is required.
DISCOURSE_SMTP_PORT TCP submission port Usually 587 for authenticated STARTTLS, unless your provider specifies another port.
DISCOURSE_SMTP_USER_NAME Authentication identity Your provider’s SMTP username, often a complete email address or generated credential.
DISCOURSE_SMTP_PASSWORD Authentication secret The SMTP password, API-generated SMTP credential or provider-specific secret.
DISCOURSE_SMTP_ENABLE_START_TLS Upgrade a plain connection to TLS using STARTTLS true when the provider expects STARTTLS, as on the usual port 587 configuration.
DISCOURSE_SMTP_FORCE_TLS Require an already encrypted TLS connection Set true for a provider’s implicit-TLS submission service, commonly port 465.
DISCOURSE_SMTP_DOMAIN Optional SMTP client/domain value Only when the provider requires it; obtain the exact value from that provider.
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE Certificate verification behavior Only when provider-specific guidance calls for it. Do not disable verification as a guess.

Discourse’s defaults are an SMTP port of 25, plain authentication and STARTTLS enabled. Authentication is used when a username or password is present. Those defaults do not mean port 25 is the right submission port for your provider; many networks block outbound port 25 or providers reserve it for server-to-server traffic.

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

Configure the variables in containers/app.yml

  1. Open a root shell on the Discourse host and change to the installation directory:

    cd /var/discourse
  2. Open the container configuration in your editor:

    sudo editor containers/app.yml

    Use the editor available on your system, such as nano or vim.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Find the existing env: block. Add or update the SMTP entries without creating a second env: key. A standard STARTTLS example is:

    env:
      DISCOURSE_SMTP_ADDRESS: smtp.example.com
      DISCOURSE_SMTP_PORT: 587
      DISCOURSE_SMTP_USER_NAME: [email protected]
      DISCOURSE_SMTP_PASSWORD: "replace-with-secret"
      DISCOURSE_SMTP_ENABLE_START_TLS: true
  4. Replace every example value with the provider’s values. Quote a password when it contains YAML-significant characters, such as :, #, braces or leading punctuation. The quotation marks are YAML syntax and are not part of the password.

    Rank #3
    Sale
    LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men | Office Gifts for Women, iPhone Stand, Gadgets for Men, Office Decor, Gaming Desk Accessories for Samsung Fold 8, Switch, iPad
    • 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)
  5. Save the file and check for common YAML mistakes: tabs instead of spaces, duplicate keys, a misplaced colon in an unquoted password and an env: block nested under the wrong parent.

Do not add DISCOURSE_SMTP_FORCE_TLS: true to a normal STARTTLS setup unless your provider specifically requires both modes. For implicit TLS on port 465, use the provider’s documented combination, normally including DISCOURSE_SMTP_FORCE_TLS: true and the corresponding port.

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

Choose the port and encryption mode your provider expects

Port Transport behavior Typical Discourse setting When to use it
25 Traditional SMTP; may begin unencrypted and negotiate according to server policy Discourse’s default port, with STARTTLS enabled by default Only when your provider and network explicitly permit authenticated submission on 25.
587 Message-submission port that commonly starts plain and upgrades with STARTTLS DISCOURSE_SMTP_PORT: 587 and DISCOURSE_SMTP_ENABLE_START_TLS: true The usual choice for authenticated application mail.
465 Implicit TLS: encryption begins as soon as the connection opens Port 465 with DISCOURSE_SMTP_FORCE_TLS: true, following provider guidance When the provider documents implicit TLS rather than STARTTLS.
2525 Alternate submission port offered by some relays Use the same TLS setting required by the provider, changing only the port When port 587 or 25 is blocked or the provider recommends 2525.

STARTTLS and implicit TLS are different protocols. Selecting port 465 while leaving a STARTTLS-only configuration, or selecting port 587 while forcing implicit TLS, commonly produces handshake errors or an immediate disconnect. Copy the provider’s current port-and-TLS pairing rather than trying combinations at random.

Load the new environment into the app container

Editing app.yml does not change the environment of an already running container. Recreate the app after saving the file:

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
cd /var/discourse
./launcher destroy app
./launcher start app

The destroy command removes the app container, not the persistent Discourse data stored in the installation’s volumes. The start command creates a new container from the edited configuration. If your maintenance procedure calls for a rebuild, the documented alternative is:

cd /var/discourse
./launcher rebuild app

A rebuild takes longer because the image and application layers may be rebuilt. Use the operation that fits your maintenance window and established backup process; in either case, ensure the newly created container receives the edited env values.

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

Set a sender address the relay will accept

SMTP authentication and sender authorization are separate checks. A relay can accept your username and password, then reject the message because the From address is not allowed. In Discourse, set the notification email address to a mailbox or verified sender permitted by the provider. If the service requires the sender to match the authenticated mailbox, use that exact mailbox address in the Discourse notification-email site setting.

Sender-domain verification may also require DNS records or a provider-side approval step. Complete those requirements before testing; changing only the SMTP password will not authorize an unverified domain.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Send a controlled test

  1. After the container has been recreated or rebuilt, sign in as a Discourse administrator.
  2. Confirm the site’s notification email setting uses the permitted From address.
  3. Trigger one predictable message, such as a password-reset email for a test account or a notification from a private test topic.
  4. Check the recipient mailbox, including its spam or quarantine folder.
  5. Inspect Discourse’s email logs and the SMTP provider’s activity or rejection log. Record the exact timestamp, recipient, response code and error text before changing settings.

Test with a mailbox you control and one message at a time. A successful SMTP connection does not guarantee inbox placement: the relay may accept the message and later defer, bounce or filter it according to its own delivery and reputation policies.

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

Troubleshoot by symptom

The forum cannot connect to the SMTP host

  • Verify that the hostname in DISCOURSE_SMTP_ADDRESS resolves from the Discourse host. A hostname that resolves on your laptop may not resolve on the server because of different DNS settings.
  • Check outbound firewall rules and hosting-provider egress restrictions for the selected port.
  • Confirm the port is the provider’s submission port, not an inbound service port intended for a mail server.
  • Try the provider’s documented alternate submission port, such as 2525, when 25 or 587 is blocked. Change only one variable at a time and then recreate the container so the test uses the new value.

TLS handshake, certificate or protocol errors

  • Match the encryption mode to the port: STARTTLS for a connection that upgrades, implicit TLS for a connection encrypted from byte one.
  • Check the provider’s required TLS version and hostname. Certificate verification normally should remain enabled.
  • Do not copy a provider-specific DISCOURSE_SMTP_OPENSSL_VERIFY_MODE value from another service. Use it only when the provider’s current instructions explain why it is needed.

Authentication fails

  • Re-enter the username exactly as issued; some services require the full email address while others issue a generated SMTP identity.
  • Reset or regenerate the SMTP credential if the provider distinguishes it from the account’s web-login password.
  • Check whether the account is allowed to submit through SMTP and whether the provider requires an additional domain value.
  • After correcting a secret in app.yml, recreate or rebuild the app; a running container keeps its old environment.

Authentication succeeds but the message is rejected

  • Read the provider’s SMTP response for a sender-policy error.
  • Set Discourse’s notification email to the authenticated mailbox or another sender explicitly verified by the provider.
  • Verify the sending domain in the provider’s control panel and publish any required DNS records.
  • Check recipient, content or rate-limit restrictions if the rejection is not sender-related.

Discourse reports success but no mail arrives

  • Look at the provider’s delivery, defer and bounce records. “Accepted” means the relay took responsibility for processing, not that the recipient placed it in the inbox.
  • Search spam, quarantine and server-side filtering at the recipient domain.
  • Confirm the recipient address and inspect Discourse’s email log for a later bounce or retry.
  • Send a second test to a different mailbox to distinguish a recipient-domain issue from a forum-wide configuration issue.

Why an existing SMTP service is usually preferable to running your own mail server

For a new community, Discourse support guidance generally favors an established SMTP service rather than operating a mail server yourself. A relay provides managed outbound connectivity, authentication, TLS support and delivery feedback. Running your own server adds DNS, reverse-DNS, IP reputation, abuse handling, queue management, bounce processing, certificate maintenance and monitoring responsibilities.

When evaluating services, compare the operational properties that affect a forum:

  • Delivery reputation: whether the service separates customers appropriately and explains reputation controls.
  • Authentication: password, generated SMTP credential, API-derived credential or other required identity.
  • Ports and TLS: support for 587 with STARTTLS, 465 implicit TLS and any alternate port such as 2525.
  • Sender verification: mailbox confirmation, domain verification and DNS requirements.
  • Logs and bounce handling: searchable message events, deferrals, bounces and complaint signals.
  • Regional availability: whether account creation, sending and data handling are available in your jurisdiction.
  • Cost and limits: recurring fees, included volume, rate limits and overage rules as currently published by the provider.

One service discussed in Discourse configuration examples is Amazon SES, but the same evaluation criteria apply to any relay. Choose based on the provider’s current documentation and your forum’s sending volume, geography and compliance requirements rather than on a port number alone.

Security and maintenance practices

  • Use a credential dedicated to the forum, with the least privilege your provider supports.
  • Limit read access to app.yml; it contains the SMTP secret alongside other deployment settings.
  • Keep a secure record of which sender domains and mailboxes are verified, so a staff change does not silently break notifications.
  • Review delivery and bounce logs after changing domains, credentials or providers.
  • Rotate the SMTP credential through a planned maintenance window: update app.yml, recreate or rebuild the app, send a controlled test and then revoke the old credential.
  • Document the selected port and TLS mode. Future administrators should not infer that port 465 is interchangeable with STARTTLS on 587.

Configuration checklist

  • DISCOURSE_SMTP_ADDRESS contains the provider’s exact hostname.
  • DISCOURSE_SMTP_PORT matches the provider’s submission service.
  • STARTTLS or implicit TLS is configured for that port, not the other mode.
  • Username and password are current, correctly quoted and stored only in the protected configuration.
  • Any required domain or provider-specific OpenSSL setting comes from current provider instructions.
  • The notification From address is an authorized mailbox or verified sender.
  • The app container was recreated or rebuilt after the file changed.
  • A test message was checked in Discourse logs, the provider log and the recipient mailbox.

The Bottom Line

For most self-hosted Discourse forums, place the provider’s SMTP hostname, credentials, port 587 and STARTTLS setting under env in /var/discourse/containers/app.yml. Recreate or rebuild the app container, use an authorized notification address and verify the result in both Discourse and the relay’s logs. Port 465 is an implicit-TLS alternative, while 2525 can help when a provider offers it or another submission port is blocked.

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.

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.

DiscourseDockerEmail configurationself-hostingSMTP

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.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
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.