Updated 2026-11-20
How to Configure SMTP for a Self-Hosted Discourse Forum
In /var/discourse/containers/app.yml set DISCOURSE_SMTP_ADDRESS: smtp.bulko.io, DISCOURSE_SMTP_PORT: 587, DISCOURSE_SMTP_USER_NAME and DISCOURSE_SMTP_PASSWORD from your Bulko dashboard, and DISCOURSE_NOTIFICATION_EMAIL on your own domain, then run ./launcher rebuild app. STARTTLS is on by default; for port 465 add DISCOURSE_SMTP_FORCE_TLS: true. Test from Admin > Emails > Server settings > Send test email.
A standard Docker install of Discourse has no mail server inside the container. Every email the forum sends goes out through the SMTP server you put in /var/discourse/containers/app.yml: activation links, password resets, invites, reply/mention/message notifications, mailing list mode and summary (digest) emails.
Activation is the one that bites first. With SMTP broken, nobody can confirm their email address, including you: the admin account is created from the address in DISCOURSE_DEVELOPER_EMAILS, and you only become admin after clicking the activation link. "I signed up and never got the activation email" is the most common Discourse install problem on Meta.
SMTP settings are not edited in the admin panel. Admin > Emails > Server settings only shows the values the container was started with. To change them, re-run ./discourse-setup or edit app.yml and rebuild. Recent installers also let you skip SMTP and use Discourse ID login, but digests, mailing list mode and email replies still need SMTP.
Discourse SMTP settings
| Field | Value |
|---|---|
| DISCOURSE_SMTP_ADDRESS (SMTP server address?) | smtp.bulko.io |
| DISCOURSE_SMTP_PORT | 587 (or 2525; 465 only with DISCOURSE_SMTP_FORCE_TLS: true). Default is 25, so always set it |
| DISCOURSE_SMTP_USER_NAME (SMTP user name?) | Your Bulko SMTP username (smtp_xxxxxxxxxxxxxxxx) |
| DISCOURSE_SMTP_PASSWORD (SMTP password?) | Your Bulko SMTP password, in double quotes |
| DISCOURSE_SMTP_ENABLE_START_TLS | true (default) for 587/2525 |
| DISCOURSE_SMTP_FORCE_TLS | true only for port 465, otherwise leave unset |
| DISCOURSE_SMTP_AUTHENTICATION | plain (default) or login; both are accepted |
| DISCOURSE_SMTP_DOMAIN | Optional HELO name, e.g. your forum hostname |
| DISCOURSE_NOTIFICATION_EMAIL | From address on a domain you control, e.g. [email protected] |
| DISCOURSE_SMTP_OPENSSL_VERIFY_MODE | Leave unset (peer); the certificate is a public Let's Encrypt one |
Step-by-step setup
- Buy an SMTP package on the Bulko SMTP Relay page and copy the username and password from Dashboard -> SMTP Access. Verify the domain you will send from under Sending domains (DKIM record at
bk1._domainkey, optionalbncReturn-Path CNAME, DMARC). - SSH into the server and
cd /var/discourse. Either run./discourse-setupagain and answer the SMTP questions with the Bulko values, or opencontainers/app.ymlin an editor. - In the
env:section setDISCOURSE_SMTP_ADDRESS,DISCOURSE_SMTP_PORT,DISCOURSE_SMTP_USER_NAMEandDISCOURSE_SMTP_PASSWORDas in the example below. Remove the leading#from any line you uncomment and keep the two-space indentation. - Put the password in double quotes. The sample file warns that a
#in an unquoted value is read as a YAML comment. - Uncomment
DISCOURSE_NOTIFICATION_EMAILand set it to an address on the domain you verified in Bulko. If you leave it unset, the forum keeps the default[email protected], which your domain cannot authenticate. - Apply the change with
./launcher rebuild app. Environment variables are read only when the container is created, so editing the file alone changes nothing. The forum is offline for a few minutes. - Run
./discourse-doctoror the admin test button (below), then sign up with a fresh address to confirm the activation email arrives.
containers/app.yml (standalone install)
## containers/app.yml (excerpt, inside the env: section)
## then: cd /var/discourse && ./launcher rebuild app
env:
DISCOURSE_SMTP_ADDRESS: smtp.bulko.io
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: smtp_xxxxxxxxxxxxxxxx
DISCOURSE_SMTP_PASSWORD: "YOUR_BULKO_SMTP_PASSWORD"
DISCOURSE_SMTP_ENABLE_START_TLS: true # default, STARTTLS on 587/2525
#DISCOURSE_SMTP_AUTHENTICATION: login # default is plain; both work
#DISCOURSE_SMTP_DOMAIN: forum.example.com # optional HELO/EHLO name
DISCOURSE_NOTIFICATION_EMAIL: [email protected]
## Port 465 (implicit TLS) instead of 587:
# DISCOURSE_SMTP_PORT: 465
# DISCOURSE_SMTP_FORCE_TLS: true
# DISCOURSE_SMTP_ENABLE_START_TLS: false # ignored when FORCE_TLS is true on current builds
Port 587, 2525 or 465 in Discourse
Discourse defaults to port 25 and STARTTLS on. Port 25 is not offered by Bulko, so DISCOURSE_SMTP_PORT must be set. The working combinations are:
| Port | app.yml |
|---|---|
| 587 (recommended) | DISCOURSE_SMTP_PORT: 587, nothing else needed |
| 2525 | DISCOURSE_SMTP_PORT: 2525, for hosts that block 587 |
| 465 | DISCOURSE_SMTP_PORT: 465 plus DISCOURSE_SMTP_FORCE_TLS: true |
Port 465 without DISCOURSE_SMTP_FORCE_TLS is the classic mistake: Discourse waits for a STARTTLS greeting that never comes and the test ends in Net::ReadTimeout. In current Discourse FORCE_TLS switches STARTTLS off by itself; on older builds Meta users also had to add DISCOURSE_SMTP_ENABLE_START_TLS: false. Never set DISCOURSE_SMTP_ENABLE_START_TLS: false on 587 or 2525: Bulko requires encryption before login.
Send a test email
In the browser go to Admin > Emails > Server settings (/admin/email/server-settings). The table shows Delivery method smtp and the address, port and user name the container is actually using. Type an address into the email address to test field and click Send test email. On success you see sent!; on failure the SMTP error text is shown next to the button.
From the shell, ./discourse-doctor asks for an address and runs rake emails:test inside the container. That task prints Testing sending to ... using smtp.bulko.io:587 and, if something is wrong, a block with ERROR and SOLUTION sections naming the exact problem.
Both tests send synchronously. Real activation and notification emails are queued in Sidekiq, so finish with an actual signup or password reset and check that it appears under Admin > Emails logs (/admin/email-logs), on the Sent tab rather than Skipped.
When the test works but users still get nothing
Everything except the test button goes through Sidekiq, Discourse's background job runner. If the dashboard shows Sidekiq is not running. Many tasks, like sending emails, are executed asynchronously by Sidekiq, emails pile up in the queue; admins can look at /sidekiq for queued, retried and dead jobs. A rebuild usually brings Sidekiq back.
Next, open /admin/email-logs/skipped. Discourse deliberately skips many notification emails and writes the reason, for example User was seen recently, user has already read this post or Exceeded max_emails_per_day_per_user (default 100 per user per day). These are not delivery problems. SMTP failures are logged there too, and the admin dashboard warns Email sending has failed N times in the past 24 hours with a link to the same page.
Also check the disable_emails site setting: when restoring a backup to a staging copy people set it to yes or non-staff and forget it. The enable_smtp site setting is unrelated to the forum's outgoing mail; it only turns on SMTP for group inboxes.
Troubleshooting
| Problem | Fix |
|---|---|
| Net::SMTPAuthenticationError: 535 Authentication failed (discourse-doctor: "Your mail server has refused your credentials as invalid") | The username or password in app.yml is wrong or got mangled by YAML. Paste both again from Dashboard -> SMTP Access, wrap the password in double quotes, and run ./launcher rebuild app. More: https://bulko.io/en/smtp-errors/535/. |
| Net::ReadTimeout on port 465, or OpenSSL::SSL::SSLError ... wrong version number | Port and TLS mode do not match. Use 587 or 2525 with STARTTLS (the default), or 465 together with DISCOURSE_SMTP_FORCE_TLS: true. |
| 530 ... STARTTLS ("Your mail server has refused to accept credentials over an unencrypted connection") | DISCOURSE_SMTP_ENABLE_START_TLS: false is set. Remove that line, keep port 587 or 2525, and rebuild. |
| Errno::ECONNREFUSED or Net::OpenTimeout "Connection timeout while making the initial connection" | The VPS provider blocks outgoing SMTP ports, or DISCOURSE_SMTP_PORT is missing and Discourse tries the default 25. Set port 2525 and rebuild; if that also fails, ask the hosting provider to unblock outgoing mail. |
| Changed app.yml but Server settings still shows the old host or port | The container was not recreated. Run ./launcher rebuild app from /var/discourse and check that the edited lines are inside env: with no leading #. |
| Test email arrives, activation emails do not, or land in spam | Check that Sidekiq is running and look at /admin/email-logs/skipped. If mail is sent but filtered, set notification_email to an address on the domain verified in Bulko so it is DKIM-signed, and add a DMARC record; use the SPF checker at https://bulko.io/en/validators/spf-checker/ to review existing SPF. |
Digest volume, the daily cap and reply by email
Bulko allows 2,000 emails per day per SMTP access. Activations and notifications rarely come close, but summaries scale with member count: by default every user gets a weekly summary (default_email_digest_frequency) if they have not visited recently, and members in mailing list mode get one email per post. For a forum with several thousand inactive members, preview a digest under Admin > Emails > Preview summary, then consider a longer default frequency, suppress_digest_email_after_days, or a second SMTP access for the bulk mail.
Reply by email needs incoming mail, which a relay does not provide: Bulko is send-only, with no IMAP or POP3. Keep sending through Bulko and point the incoming side at a mailbox you already have: enable reply_by_email_enabled, set reply_by_email_address (for example replies+%{reply_key}@example.com) and the pop3_polling_* settings to that mailbox's POP3 server, or run the separate mail-receiver container.
FAQ
Can I change Discourse SMTP settings in the admin panel?
No. The global SMTP server comes from environment variables in containers/app.yml; Admin > Emails > Server settings only displays them. Re-run ./discourse-setup or edit app.yml and run ./launcher rebuild app.
Where do I change the From address of Discourse emails?
It is the notification_email site setting (Admin > Settings, search notification_email), which DISCOURSE_NOTIFICATION_EMAIL in app.yml seeds. Use an address on a domain you verified in Bulko; the site setting can be changed without a rebuild.
I can't log in because the activation email never arrived. What now?
Fix SMTP first and use the admin test or discourse-doctor. If you must get in before that, run ./launcher enter app and then rake admin:create to create an admin account from the console.
Can I keep using Microsoft 365 or Gmail for Discourse?
Discourse's own test task warns that sending forum mail through Gmail violates Google's terms. Microsoft 365 needs SMTP AUTH, which Exchange Online disables by default for Basic auth at the end of December 2026; see https://bulko.io/en/smtp-relay/microsoft-365-basic-auth/.
Does Bulko handle reply by email for Discourse?
No. Bulko only sends; there is no IMAP or POP3. Use POP3 polling against your existing mailbox or the mail-receiver container for incoming replies.
How much does it cost?
Bulko SMTP Relay is sold as one-time packages: $5 for 5,000 emails, $15 for 20,000, $30 for 50,000 or $60 for 150,000, paid by card or crypto, no subscription, and unused emails never expire.
Get SMTP credentials for Discourse
One-time payment by card or crypto, no subscription. Unused emails never expire. 2,000 emails per day per SMTP account.
What you can send: Acceptable Use Policy.