logo Home
  • Sysadmins
  • Email
  • Documentation

How to use a self-signed cert with Discourse for emails

  • Users
    • Features
    • How does title and favicon notification work?
    • What are Badges?
    • What are Flags and how do they work?
    • What are "Likes"?
    • What are Mentions?
    • What do user trust levels do?
    • What is a Wiki Post?
    • What is "Infinite Scrolling"?
  • Administrators
    • Essentials
    • Configure automatic backups for Discourse
    • Configure custom emoji
    • Configure your domain name for hosted Discourse
    • Creating and Submitting XML Sitemaps to Google, Bing & Yandex
    • Customize subject format for standard emails
    • Export User Information List
    • Grant a badge to individual users manually
    • How to change FAQ, Privacy Policy, and Terms of Service
    • How to enable Piwik analytics on Discourse
    • Link User Title to a Group
    • Recover a user who was deleted as a spammer
    • Sending Bulk User Invites
    • Setting up file and image uploads to S3
    • Some common badge queries idea
    • Email
    • How to configure mailbox in Google Apps for user-friendly incoming email addresses for discourse categories (with screenshots)
    • Set up "Email In" (start topic via email)
    • Set up reply via email support
    • Use one Fastmail account to serve multiple Discourse instances
    • Logins
    • Configuring Facebook login for Discourse
    • Configuring GitHub login for Discourse
    • Configuring Google OAuth2 login for Discourse
    • Configuring Twitter login for Discourse
    • Using Discourse as a SSO provider
  • Designers
    • Tweaks
    • Custom header with dropdown navigation
    • Custom nav header like discourse.org
  • Sysadmins
    • Install
    • How Do I Install Discourse?
    • Install Discourse in the Cloud
    • How to create an administrator account after install
    • Change the domain name or rename my Discourse?
    • Essentials
    • Change the domain name or rename my Discourse?
    • Change tracking branch for your Discourse instance
    • Enable a CDN for your Discourse
    • Full site CDN acceleration for Discourse
    • How do I update my Docker image to latest?
    • Install a Plugin
    • Move your Discourse Instance to a Different Server
    • Email
    • Configure your domain for Discourse hosted email
    • How to use a self-signed cert with Discourse for emails
    • Troubleshooting email on a new Discourse install
    • Docker
    • Understanding Discourse Docker
    • Multisite configuration with Docker
    • How to configure Discourse Docker on higher end servers
    • How to use Docker multiple containers without exposing ports
    • Migrating an old Discourse install to Docker
    • Host run support for launcher
    • Running other websites on the same machine as Discourse
    • Subfolder support with Docker
    • Troubleshooting Docker Installation Issues
    • Advanced Setup and Administration
    • Miscellaneous
    • Adjust Discourse search to work with CJK languages
    • Advanced, manual method of manually creating and restoring Discourse backups
    • Adventures in haproxy and varnish with discourse because i hate myself
    • Beginners Guide to Install Discourse on Mac OS X for Development
    • Beginners Guide to Install Discourse on Ubuntu for Development
    • Changing Max Attachment Size
    • Configure a firewall for Discourse
    • Create a swapfile for your Linux server
    • Create Admin Account from Console
    • Deploy Discourse to an Ubuntu VPS using Capistrano
    • Deploying Discourse to Amazon (and other clouds)
    • How do I enable DKIM for non-hosted Discourse emails?
    • How to deploy Discourse in 8 minutes with Juju
    • How to set up Discourse on a server with existing Apache sites
    • Migrating from Heroku to a Hosted/Cloud instance
    • Redirect single/multiple domain(s) to your Discourse instance
    • Replace rubygems.org with taobao mirror to resolve network error in China
    • Simple Discourse Deployment with Rubber
  • Developers
    • Environment
    • Discourse Advanced Developer Install Guide
    • Developing under OS X Without Vagrant
    • Setting up Docker in Virtualbox for 'production' testing
    • Discourse Developer Testing Guide
    • Discourse Developer Install Guide (Vagrant)
    • Creating plugins
    • Beginner's Guide to Creating Discourse Plugins
    • Beginner's Guide to Creating Discourse Plugins Part 2: Plugin Outlets
    • Beginner's Guide to Creating Discourse Plugins Part 3: Custom Settings
    • Beginner's Guide to Creating Discourse Plugins Part 4: Git Setup
    • Beginner's Guide to Creating Discourse Plugins Part 5: Admin Interfaces
    • Beginner’s Guide to Creating Discourse Plugins Part 6: Acceptance Tests
    • Plugin Outlet Locations
    • Plugin Tutorial
    • Hacking
    • Using the Discourse API Ruby Gem
    • Discourse API Documentation
    • How to reverse engineer the Discourse API
    • Adding plugin-outlets using site customizations
    • Create group via API
    • Generating lots of Invite Links
    • Invite individual users to a group
    • A badge for all members of a group
    • Triggered custom badge queries
    • Edit a user setting for all Discourse users
    • Embedding Discourse Comments via Javascript
    • Message Format support for localization
    • How to test Discourse in mobile screen emulator
    • Any kind of Data-Input (also anonymous) through Google-Forms
    • Tuning Ruby and Rails for Discourse
    • Official Single-Sign-On for Discourse
    • Forum import
    • Migrating to Discourse from another Forum software
    • Importing from phpBB3
    • How to migrate from Vanilla to Discourse!
    • How to import a Phorum database (via Vanilla Porter)
    • Import posts from Facebook group into Discourse
    • Import from Google Groups to Discourse
    • Archive an old forum "in place" to start a new Discourse forum
    • Redirecting old forum URLs to new Discourse URLs

Using a self-signed certificate with your SMTP and POP mail in Discourse is easy once you know how - here’s how!

There is a condition, and that is that your hostname (main domain for server - usually the domain used for your name servers) allows your other domains to check email through it (usually via mail.domain.com). Most hosting panels allow this.

Steps

  • First create your self-signed certificate - just make sure your ‘web server hostname’ does not have http or www (so something like yourdomain.com)

  • Then upload the certificate (not the key!) to somewhere on your server, such as yourmainsite.com/certs/8777373333.crt

  • Then add the following code to your app.yml:

run:
 - file:
     path: /tmp/add-cert
     chmod: +x
     contents: |
       #!/bin/bash -e
       #Download cert
       wget http://yourmainsite.com/certs/8777373333.crt  -O - > /usr/local/share/ca-certificates/your-email-cert.crt
       update-ca-certificates

 - exec: "/tmp/add-cert"

(Change http://yourmainsite.com/certs/8777373333.crt to match your details)

  • Then ./launcher rebuild app to rebuild your app.

  • Then in your admin control panel, make sure the pop3 polling host setting is just the hostname (so not mail.domain.com, just domain.com).

That’s it!!

If you need to trouble shoot:

./launcher enter app

Then cd /etc/ssl/certs and make sure your crt is there.

Thanks to @riking for all his help in this :)

Source: https://meta.discourse.org/t/how-to-use-a-self-signed-cert-with-discourse-for-emails/32042

Content is by-nc-sa, Discourse logo and “Discourse Forum” ® belongs to Civilized Discourse Construction Kit, Inc. and used with permit.

Built with love, Internet style