Hello! I have a weird issue where I’ve set this up following the guide, and it works great! However, something has gone wrong with outbound email, which I thought wouldn’t be affected by any of this. Sidekiq gives the following error for every attempted email (all of them stuck in the Retries list) since I turned on mail-receiver:
Jobs::HandledExceptionWrapper: Wrapped OpenSSL::SSL::SSLError: SSL_read: unexpected eof while reading
My searching leads me to believe that this is related to TLS somehow. I had uncommented the TLS-related lines in the .yml file, but re-commenting them didn’t fix the issue either. I tried the instructions in the guide for resolving Postfix conflicts, but I apparently don’t have Postfix? (The /etc/postfix
directory in the guide doesn’t exist on my instance, nor does it recognize postfix as a service.) And according to the netstat results, only docker-proxy is using port 25.
We’re using Gmail as the outbound SMTP service, and in fact we were using Gmail for inbound POP3 polling before this. I did delete a bunch of MX records pointing to Google, but the guide said to do that.
This is my mail-receiver.yml, with certain details redacted, of course:
## this is the incoming mail receiver container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild mail-receiver
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
base_image: discourse/mail-receiver:release
update_pups: false
expose:
- "25:25" # SMTP
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
## Where e-mail to your forum should be sent. In general, it's perfectly fine
## to use the same domain as the forum itself here.
MAIL_DOMAIN: discourse.[mydomain].org
# uncomment these (and the volume below!) to support TLS
POSTCONF_smtpd_tls_key_file: /letsencrypt/discourse.[mydomain].org/discourse.[mydomain].org.key
POSTCONF_smtpd_tls_cert_file: /letsencrypt/discourse.[mydomain].org/fullchain.cer
POSTCONF_smtpd_tls_security_level: may
## The base URL for this Discourse instance.
## This will be whatever your Discourse site URL is. For example,
## https://discourse.example.com. If you're running a subfolder setup,
## be sure to account for that (ie https://example.com/forum).
DISCOURSE_BASE_URL: 'https://discourse.[mydomain].org'
## The master API key of your Discourse forum. You can get this from
## the "API" tab of your admin panel.
DISCOURSE_API_KEY: [myapikey]
## The username to use for processing incoming e-mail. Unless you have
## renamed the `system` user, you should leave this as-is.
DISCOURSE_API_USERNAME: system
volumes:
- volume:
host: /var/discourse/shared/mail-receiver/postfix-spool
guest: /var/spool/postfix
# uncomment to support TLS
- volume:
host: /var/discourse/shared/standalone/letsencrypt
guest: /letsencrypt
Email tech is a bit out of my expertise, so I appreciate any advice, even if it’s to point out that I missed something stupid when I was setting this up. Thanks!