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.
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"
http://yourmainsite.com/certs/8777373333.crt to match your details)
./launcher rebuild appto rebuild your app.
Then in your admin control panel, make sure the
pop3 polling hostsetting is just the hostname (so not mail.domain.com, just domain.com).
If you need to trouble shoot:
./launcher enter app
cd /etc/ssl/certs and make sure your crt is there.
Thanks to @riking for all his help in this :)