디스커스 팀에,
오늘 아침 #mail-receiver와 앱을 재빌드한 후, 이전에 정상적으로 전송되던 이메일에서 다음과 같은 결과가 나오고 있습니다.
이것이 Ubuntu 커널 업데이트 후 시스템 시계 문제일 수 있을까요?
음, 메일 수신 컨테이너와 앱 컨테이너 모두 호스트 시스템과 다른 시간으로 설정되어 있네요.
호스트 시스템 - 올바른 시간 ![]()
앱 컨테이너 - 잘못된 시간 ![]()


메일 수신 컨테이너 - 잘못된 시간 ![]()

음, 그래서 메일 수신기 컨테이너와 앱 컨테이너 모두 호스트 시스템과 다른 시간으로 설정되어 있군요
다른 시간대로 설정되어 있는 것 같은데, 그렇게 되어 있는 건 문제없습니다.
이 명령어들을 몇 분 간격으로 실행했다면, 이 정도면 괜찮아 보입니다.
이 스크린샷만으로는 정확히 무슨 일이 일어나고 있는지 파악하기 어렵습니다.
포럼의 수신 주소는 무엇인가요? (가능한 경우 일부 마스킹 처리해 주세요)
이메일은 어떤 주소에서 온 건가요?
그 주소로 전송된 메일에 대해 어떤 일이 일어나고 있나요?
스크린샷 대신 로그 텍스트를 사용해 주세요.
포럼의 수신 주소는 무엇인가요? (가능하다면 일부 편집된 형태로)
발신 주소는 무엇인가요?
해당 주소로 발송된 메일에 대해 어떤 일이 일어나고 있나요?
mail-receiver에 연결되지만, mail-receiver가 해당 IP를 알 수 없는 것으로 인식하여 메일을 반송(bounce)합니다. 결과적으로 메일은 mail-receiver의 큐에 도착하지 않습니다.
메일 수신기가 IP를 알 수 없는 것으로 인식하여 메일을 반송합니다.
이것이 정확하지 않다고 생각합니다. 이것은 오류가 아니라 경고입니다.
이 스크린샷(이 텍스트를 생성해 주세요)은 ppyem30@discourse.domain.com 주소가 허용되지 않음을 나타내며, 이것이 실패의 원인으로 보입니다.
using backwards-compatible default setting…라는 줄을 더 자세히 살펴보는 것이 좋습니다. 이 문구가 실패 원인에 대한 단서를 제공하고 있는 것 같습니다.
root@ubuntu:/var/discourse# Jul 17 15:40:20 ubuntu-mail-receiver postfix/master[1]: daemon started -- version 3.7.11, configuration /etc/postfix
Jul 17 15:41:32 ubuntu-mail-receiver postfix/smtpd[122]: connect from btprdrgo001.btinternet.com[65.20.50.131]
Jul 17 15:41:32 ubuntu-mail-receiver postfix/smtpd[122]: disconnect from btprdrgo001.btinternet.com[65.20.50.131] ehlo=1 quit=1 commands=2
Jul 17 15:41:32 ubuntu-mail-receiver postfix/smtpd[122]: connect from btprdrgo001.btinternet.com[65.20.50.6]
Jul 17 15:41:32 ubuntu-mail-receiver postfix/smtpd[122]: NOQUEUE: reject: RCPT from btprdrgo001.btinternet.com[65.20.50.6]: 554 5.7.1 <person@discourse.redacted.com>: Recipient address rejected: Mail to this address is not accepted. Check the address and try to send again?; from=<ethan.redacted@btinternet.com> to=<person@discourse.redacted.com> proto=ESMTP helo=<btprdrgo001.btinternet.com>
Jul 17 15:41:32 ubuntu-mail-receiver postfix/smtpd[122]: using backwards-compatible default setting smtpd_relay_before_recipient_restrictions=no to reject recipient "person@discourse.redacted.com" from client "btprdrgo001.btinternet.com[65.20.50.6]"
Jul 17 15:41:32 ubuntu-mail-receiver postfix/smtpd[122]: disconnect from btprdrgo001.btinternet.com[65.20.50.6] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6
Jul 17 15:42:49 ubuntu-mail-receiver postfix/smtpd[122]: warning: hostname unassigned.quadranet.com does not resolve to address 198.55.98.78
Jul 17 15:42:49 ubuntu-mail-receiver postfix/smtpd[122]: connect from unknown[198.55.98.78]
Jul 17 15:42:49 ubuntu-mail-receiver postfix/smtpd[122]: disconnect from unknown[198.55.98.78] ehlo=1 auth=0/1 quit=1 commands=2/3
Jul 17 15:43:35 ubuntu-mail-receiver postfix/smtpd[122]: connect from unknown[196.251.92.207]
Jul 17 15:43:36 ubuntu-mail-receiver postfix/smtpd[122]: disconnect from unknown[196.251.92.207] ehlo=1 quit=1 commands=2
다음 명령을 실행한 후
./launcher destroy mail-receiver
여기의 지침을 따르세요.
Delivering mail sent to discourse.DOMAINNAME.com to Discourse
Starting OpenDKIM...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Adding user `postfix' to group `opendkim' ...
<86>Jul 17 16:00:00 usermod[17]: add 'postfix' to group 'opendkim'<86>Jul 17 16:00:00 usermod[17]: add 'postfix' to shadow group 'opendkim'Done.
Starting OpenDMARC...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
<22>Jul 17 16:00:00 opendkim[25]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)Adding user `postfix' to group `opendmarc' ...
<86>Jul 17 16:00:00 usermod[32]: add 'postfix' to group 'opendmarc'<86>Jul 17 16:00:00 usermod[32]: add 'postfix' to shadow group 'opendmarc'Done.
<22>Jul 17 16:00:00 opendmarc[40]: OpenDMARC Filter v1.4.2 starting (args: -c /etc/opendmarc.conf)<22>Jul 17 16:00:00 opendmarc[40]: additional trusted authentication services: (none)postfix: Postfix is using backwards-compatible default settings
Jul 17 16:00:00 ubuntu-mail-receiver postfix[52]: Postfix is using backwards-compatible default settings
postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jul 17 16:00:00 ubuntu-mail-receiver postfix[52]: See http://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=3.6" and "postfix reload"
Jul 17 16:00:00 ubuntu-mail-receiver postfix[52]: To disable backwards compatibility use "postconf compatibility_level=3.6" and "postfix reload"
Starting Postfix
Jul 17 16:00:00 ubuntu-mail-receiver postfix/master[1]: daemon started -- version 3.7.11, configuration /etc/postfix
Jul 17 16:00:28 ubuntu-mail-receiver postfix/smtpd[123]: connect from mail-ukwestazon11021090.outbound.protection.outlook.com[52.101.100.90]
Jul 17 16:00:28 ubuntu-mail-receiver postfix/smtpd[123]: NOQUEUE: reject: RCPT from mail-ukwestazon11021090.outbound.protection.outlook.com[52.101.100.90]: 554 5.7.1 <person@discourse.DOMAINNAME.com>: Recipient address rejected: Mail to this address is not accepted. Check the address and try to send again?; from=<ethan@DOMAINNAME.com> to=<person@discourse.DOMAINNAME.com> proto=ESMTP helo=<CWXP265CU009.outbound.protection.outlook.com>
Jul 17 16:00:28 ubuntu-mail-receiver postfix/smtpd[123]: using backwards-compatible default setting smtpd_relay_before_recipient_restrictions=no to reject recipient "person@discourse.DOMAINNAME.com" from client "mail-ukwestazon11021090.outbound.protection.outlook.com[52.101.100.90]"
Jul 17 16:00:28 ubuntu-mail-receiver postfix/smtpd[123]: disconnect from mail-ukwestazon11021090.outbound.protection.outlook.com[52.101.100.90] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4
오류 세부 정보
오류: 554 5.7.1 <person@discourse.YOURDOMAIN.com>: 수신자 주소가 거부되었습니다: 이 주소로 전송된 메일은 수신이 되지 않습니다. 주소를 확인한 후 다시 보내시겠습니까?
메시지를 거부한 대상: ubuntu-mail-receiver.localdomain
using backwards-compatible default setting…라는 줄을 더 자세히 살펴보는 것이 좋을 것 같습니다. 그 부분이 원인을 암시하고 있는 것 같습니다.
i tried ask.discourse.com
Supermathie가 암시하고 있는 것은 Discourse의 direct-delivery 메일 수신기 설정에서 지원하는 기능으로, Discourse 메일 수신기 컨테이너가 수신 메일을 허용할 이메일 주소를 제한할 수 있습니다. 이는 메일 수신기 Docker 컨테이너 구성, 보통
mail-receiver.yml파일 내에 “valid_recipients” 파일을 생성하고 마운트함으로써 이루어집니다.이것이 의미하는 바와 왜 이렇게 해야 하는지 설명드리겠습니다:
mount_recipients 파일은 무엇을 의미합니까?
mail-receiver.yml의volumes:섹션 아래에 다음 줄을 추가합니다:- /var/discourse/shared/mail-receiver/valid_recipients:/etc/postfix/valid_recipients이 줄은 Docker에 호스트 시스템의
/var/discourse/shared/mail-receiver/valid_recipients파일을 컨테이너의/etc/postfix/valid_recipients경로로 매핑하라고 지시합니다.
valid_recipients 파일의 용도는 무엇입니까?
/var/discourse/shared/mail-receiver/valid_recipients파일을 직접 생성하고, 한 줄에 하나의 유효한 수신자 이메일 주소를 입력합니다. 예를 들어:discourse@discourse.yourdomain.com incoming+test@discourse.yourdomain.com이렇게 하면 메일 수신기 컨테이너의 Postfix는 이 목록에 포함된 주소로만 전송된 이메일을 수락합니다. 다른 모든 이메일은 SMTP 레벨에서 거부됩니다.
왜 valid_recipients 파일을 사용해야 합니까?
- 보안: 이메일을 통해 Discourse로 게시할 수 있는 대상을 제한하여 스팸이나 악용의 가능성을 줄입니다.
- 제어: 포럼이 "수신"할 정확한 주소를 지정할 수 있어, 사용자 정의 이메일 라우팅이 많거나 특정 그룹 또는 카테고리 이메일 주소만 허용하려는 경우에 유용합니다.
- 디버깅 및 필터링: 처리를 위해 메일이 수락되는 대상이 의도된 수신자만 있도록 보장함으로써 디버깅에 도움이 됩니다.
이것은 어디에 문서화/논의되어 있습니까?
사용 방법은 meta의 Discourse 수신 이메일 설정 가이드 여러 곳에서 설명되어 있지만, Supermathie의 게시물은 Discourse 내부 처리 단계에서만이 아닌 Postfix(SMTP 서버) 레벨에서 강제 적용하는 단축 경로를 제공하고 있습니다.
direct-delivery 설정 개요와 고급 사용을 위한 Postfix 커스터마이징에 대한 자세한 내용은 다음과 같습니다:
- Configure direct-delivery incoming email for self-hosted sites with Mail-Receiver
- Customising the Postfix configuration of your mail-receiver container
“valid_recipients” 접근 방식에 대한 구체적인 힌트는 이 meta 답변에서도 볼 수 있습니다:
요약:
Supermathie의 힌트는 메일 수신기 컨테이너에 마운트된 “valid_recipients” 파일에 허용된 수신자 주소 목록을 지정하여, SMTP 서버 레벨에서 Discourse가 메일을 수신할 주소를 엄격하게 제어하는 방법입니다. 이는 수신 메일의 보안과 제어를 돕습니다. 자세한 내용은 공식 가이드를 참고하십시오:
지시된 단계를 따랐습니다. /var/discourse/shared/mail-receiver/ 디렉터리로 이동했을 때 명확히 해야 할 부분이 하나 있었습니다.
nano valid_recipients
을 입력해야 했는지, 아니면
nano valid_recipients.yml
을 입력해야 했는지요.
mail-reciever.yml 파일에 내용을 복사하여 붙여넣은 후 다시 빌드했는데, 아래 로그와 일치합니다.
root@ubuntu:/var/discourse# ./launcher logs mail-receiver
x86_64 arch detected.
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Operating environment:
HOSTNAME=ubuntu-mail-receiver
LANGUAGE=en_US.UTF-8
MAIL_DOMAIN=discourse.DOMAINNAME.com
DOCKER_HOST_IP=172.17.0.1
PWD=/
DISCOURSE_BASE_URL=https://DOMAINNAME.com
HOME=/root
LANG=en_US.UTF-8
TERM=xterm
SHLVL=1
DISCOURSE_API_USERNAME=system
LC_ALL=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
INCLUDE_DMARC=true
DISCOURSE_API_KEY=[64 digit api key redacted]
_=/usr/bin/env
Delivering mail sent to discourse.DOMAINNAME.com to Discourse
Starting OpenDKIM...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Adding user `postfix' to group `opendkim' ...
<86>Jul 17 19:38:44 usermod[16]: add 'postfix' to group 'opendkim'<86>Jul 17 19:38:44 usermod[16]: add 'postfix' to shadow group 'opendkim'Done.
Starting OpenDMARC...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
<22>Jul 17 19:38:44 opendkim[24]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)Adding user `postfix' to group `opendmarc' ...
<86>Jul 17 19:38:44 usermod[31]: add 'postfix' to group 'opendmarc'<86>Jul 17 19:38:44 usermod[31]: add 'postfix' to shadow group 'opendmarc'Done.
<22>Jul 17 19:38:44 opendmarc[39]: OpenDMARC Filter v1.4.2 starting (args: -c /etc/opendmarc.conf)<22>Jul 17 19:38:44 opendmarc[39]: additional trusted authentication services: (none)postfix: Postfix is using backwards-compatible default settings
Jul 17 19:38:44 ubuntu-mail-receiver postfix[49]: Postfix is using backwards-compatible default settings
postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jul 17 19:38:44 ubuntu-mail-receiver postfix[49]: See http://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=3.6" and "postfix reload"
Jul 17 19:38:44 ubuntu-mail-receiver postfix[49]: To disable backwards compatibility use "postconf compatibility_level=3.6" and "postfix reload"
Starting Postfix
Jul 17 19:38:44 ubuntu-mail-receiver postfix/master[1]: daemon started -- version 3.7.11, configuration /etc/postfix
Jul 17 19:39:12 ubuntu-mail-receiver postfix/smtpd[171]: connect from smtp3.nottingham.ac.uk[128.243.44.55]
Jul 17 19:39:12 ubuntu-mail-receiver postfix/smtpd[171]: NOQUEUE: reject: RCPT from smtp3.nottingham.ac.uk[128.243.44.55]: 554 5.7.1 <person.self@discourse.DOMAINNAME.com>: Recipient address rejected: Mail to this address is not accepted. Check the address and try to send again?; from=<person@nottingham.ac.uk> to=<person.xytz@discourse.DOMAINNAME.com> proto=ESMTP helo=<smtp3.nottingham.ac.uk>
Jul 17 19:39:12 ubuntu-mail-receiver postfix/smtpd[171]: using backwards-compatible default setting smtpd_relay_before_recipient_restrictions=no to reject recipient "person.xytz@discourse.DOMAINNAME.com" from client "smtp3.nottingham.ac.uk[128.243.44.55]"
Jul 17 19:39:12 ubuntu-mail-receiver postfix/smtpd[171]: disconnect from smtp3.nottingham.ac.uk[128.243.44.55] ehlo=1 mail=1 rcpt=0/1 bdat=0/1 quit=1 commands=3/5
여러 카테고리에 대해 사용자 정의 수신 이메일 주소를 설정하고 있습니다. (카테고리에 직접 게시하기 위해) 형식을 category+<tag>@discourse.DOMAINNAME.com으로 변경해야 하나요?