# Configure direct-delivery incoming email for self-hosted sites with Mail-Receiver

**URL:** https://meta.discourse.org/t/configure-direct-delivery-incoming-email-for-self-hosted-sites-with-mail-receiver/49487
**Category:** Self-Hosting
**Tags:** email, how-to, advanced-setup, mail-receiver
**Created:** [8월 31, 2016, 10:58오전 UTC](https://meta.discourse.org/t/configure-direct-delivery-incoming-email-for-self-hosted-sites-with-mail-receiver/49487 "2016-08-31T10:58:09Z")
**Posts on this page:** 1
**Showing post:** 511

<div class="post-metadata">

### Author: ![Ryan\_Hyer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryan_hyer/32/159861_2.png) [@Ryan\_Hyer](https://meta.discourse.org/u/Ryan_Hyer)
#### Post date: [9월 12, 2024, 9:55오후 UTC](https://meta.discourse.org/t/configure-direct-delivery-incoming-email-for-self-hosted-sites-with-mail-receiver/49487/511 "2024-09-12T21:55:27Z")

</div>

안녕하세요! 가이드를 따라 설정을 마쳤는데, 잘 작동하고 있습니다! 다만, 이 설정들과는 무관할 것이라고 생각했던 _외부 발송(outbound)_ 이메일에서 문제가 발생했습니다. mail-receiver를 활성화한 이후로, 모든 이메일 시도(모두 Retries 목록에 머물러 있는 상태)에 대해 Sidekiq가 다음 오류를 보고합니다:

`Jobs::HandledExceptionWrapper: Wrapped OpenSSL::SSL::SSLError: SSL_read: unexpected eof while reading`

검색 결과에 따르면 이것이 TLS와 관련이 있는 것 같습니다. .yml 파일에서 TLS 관련 줄을 주석 해제했는데, 다시 주석 처리해도 문제가 해결되지 않았습니다. 가이드에 있는 Postfix 충돌 해결 지침을 시도해 보았지만, 제 인스턴스에는 Postfix가 없는 것 같습니다? (가이드에 언급된 `/etc/postfix` 디렉토리가 제 인스턴스에 존재하지 않으며, postfix를 서비스로 인식하지도 않습니다.) 그리고 netstat 결과에 따르면 포트 25를 사용하는 것은 docker-proxy뿐입니다.

우리는 외부 SMTP 서비스로 Gmail을 사용하며, 사실 이 설정 이전에도 수신 POP3 폴링에 Gmail을 사용していました. Google을 가리키는 MX 레코드 여러 개를 삭제했지만, 가이드에서는 그렇게 하라고 했습니다.

아래는 특정 세부 사항을 삭제한 제 mail-receiver.yml 파일입니다:

```plaintext
## 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

```

이메일 기술은 제 전문 분야가 아니므로, 조언을 감사히 받겠습니다. 설정을 할 때 멍청한 실수를 했다는 지적이라도 좋습니다. 감사합니다!

---

_[View the full topic](https://meta.discourse.org/t/configure-direct-delivery-incoming-email-for-self-hosted-sites-with-mail-receiver/49487)._
