첫 번째 가입 이메일이 전송되지 않았습니다

안녕하세요,

방금 새로 설치한 Discourse에 대해 문의드립니다.

최초 연결 시 관리자 계정의 로그인과 비밀번호를 생성하라는 안내가 있었고, 활성화 이메일이 전송되어야 했습니다.

하지만 이 활성화 이메일을 받지 못했습니다(물론 스팸 폴더도 확인했습니다). 그래서 닥터를 실행하고, 요청대로 제게 테스트 메시지를 보내 보았습니다. 이 이메일은 즉시 받은 편지함에 도착했습니다.

명령줄을 통해 관리자 계정을 만들 수는 있다는 것을 알고 있지만, 앞으로 가입하려는 다른 사용자들에게도 동일한 문제가 발생할 수 있으므로 무엇이 일어나고 있는지 이해하고 싶습니다.

도움 주실 수 있을까요?

감사합니다.

아마 두 가지 중 하나가 잘못되었을 수 있습니다:

  • 메일이 전송되지 않았습니다.
  • 메일은 전송되었지만 배달되지 않았습니다.

이 인스턴스가 새로 생성된 것이므로, rails 콘솔에서 모든 발신 이메일 로그를 확인하는 것이 가장 쉽습니다:

discourse(prod)> EmailLog.all.pluck(:to_address, :email_type, :created_at, :smtp_transaction_response)

무언가가 보인다면, 적어도 SMTP 서버에 인계되었음을 알 수 있으며, 여기까지가 Discourse의 책임 범위입니다.

보이지 않는다면, 메일이 전송되지 않은 것이므로 관리자 계정으로 로그인한 후 /logs/sidekiq URL 경로를 확인하면 유용한 로그를 찾을 수 있을 것입니다.

./discourse-doctor 명령을 통해 test 메시지가 전송되었음을(실제로 저도 수신했습니다) 확인할 수 있습니다. 그러나 registration 메시지에 대한 기록은 없습니다:

discourse(prod)> EmailLog.all.pluck(:to_address, :email_type, :created_at, :smtp_transaction_response)
=> [["user@domain.org", "test_message", 2026-05-13 16:23:41.417177000 UTC +00:00, "250 2.0.0 Ok: queued as 4B4DDB0059A"]]

production.log 파일에서 네 개의 registration 메시지를 찾을 수 있습니다(실제로 4회 가입을 시도했습니다). 하지만 해당 registration 메시지는 수신되지 않았으므로, 오류나 경고가 없더라도 전송조차 되지 않았을 것으로 추정됩니다.
성공적으로 전송(및 수신)된 test 메시지의 흔적은 이 로그들에 전혀 없습니다.

root@my-vps-app:/var/www/discourse/log# cat production.log | grep user
  Parameters: {"authenticity_token" => "ityyLIdjT7xvdxEd01LjMT08-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}
  Parameters: {"authenticity_token" => "tnDxYkOOwXYcv59Ez4t8vWPir-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}
  Parameters: {"authenticity_token" => "bvOwVYHS3N_UELipxVEG3L3LY-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}
  Parameters: {"authenticity_token" => "oo6GN-n7clGI5F1-uqzsZcadeP-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}

다른 로그 파일은 비어 있습니다:

root@my-vps-app:/var/www/discourse/log# cat production_errors.log 
root@my-vps-app:/var/www/discourse/log# cat sidekiq.log 
root@my-vps-app:/var/www/discourse/log# cat unicorn.stderr.log 
root@my-vps-app:/var/www/discourse/log# cat unicorn.stdout.log 

discourse 앱의 docker 로그에는 무언가 누락되었다는 메시지가 네 개 표시됩니다(실패한 registration 메시지가 네 개인 것과 일치합니다):

root@my-vps:/var/discourse# docker logs app
...
I, [2026-05-13T16:14:30.769269 #3290]  INFO -- : worker=7 gen=0 pid=4295 registered
I, [2026-05-13T16:14:30.815178 #4295]  INFO -- : worker=7 gen=0 pid=4295 ready
X-Accel-Mapping header missing
X-Accel-Mapping header missing
X-Accel-Mapping header missing
X-Accel-Mapping header missing

이 정보가 도움이 될까요?

가입 이메일이 도착하지 않아 커맨드 라인을 통해 관리자 계정을 활성화했습니다.

관리자 계정으로 로그인한 후, 관리자 / 이메일 설정 / 서버 설정 → 테스트 이메일 보내기 메뉴에서 anotheruser@anotherdomain.org로 테스트 이메일을 보냈습니다.

아래에서 확인할 수 있듯이 이 테스트 이메일은 즉시 전송되어 제 받은 편지함에 배달되었습니다:

root@my-vps:/var/discourse# ./launcher enter app
x86_64 arch detected.
root@my-vps-app:/var/www/discourse# rails console
Loading production environment (Rails 8.0.5)
discourse(prod)> EmailLog.all.pluck(:to_address, :email_type, :created_at, :smtp_transaction_response)
=> 
[["user@domain.org",
  "test_message",
  2026-05-13 16:23:41.417177000 UTC +00:00,
  "250 2.0.0 Ok: queued as 4B4DDB0059A"],
 ["anotheruser@anotherdomain.org",
  "test_message",
  2026-05-16 14:44:42.978862000 UTC +00:00,
  "250 2.0.0 Ok: queued as D79DFB00573"]]

그 후 같은 이메일 주소(anotheruser@anotherdomain.org)로 가입을 시도해 보았지만, 가입 이메일은 배달되지 않았습니다(레일스 콘솔 로그에 기록이 없으므로 전송되지도 않았습니다).

결론적으로, 테스트 이메일은 전송되고 배달되지만, production.log에 흔적이 남아 있음에도 불구하고 가입 이메일은 전송되지 않습니다:

cat production.log | grep anotheruser
  Parameters: {"email_address" => "anotheruser@anotherdomain.org"}
Started GET "/u/check_email?email=anotheruser%40anotherdomain.org" for xxx.xxx.xxx.xxx at 2026-05-16 17:40:45 +0000
  Parameters: {"email" => "anotheruser@anotherdomain.org"}
  Parameters: {"email" => "anotheruser@anotherdomain.org", "password" => "[FILTERED]", "username" => "NewUser", "password_confirmation" => "[FILTERED]", "challenge" => "xxxxxxxx", "timezone" => "Europe/Paris"}

사람들이 가입할 수 없는데 이 문제를 해결하기 위해 무엇을 할 수 있을까요?

결국 다른 SMTP 제공업체로 전환했고 지금은 모든 것이 정상적으로 작동하지만, 무슨 일이 있었는지 끝내 파악하지 못한 것이 짜증나네요…

어떤 이메일 서비스는 그냥 안 되는 경우가 있습니다. 처음에는 원인을 찾느라 오래 걸렸는데, 나중에 Mailgun을 사용하니 문제가 해결되었습니다. 제가 아는 바로는 QQ 이메일은 Discourse와 잘 호환되지 않습니다.

관리자로 로그인한 후, 여기에 어떤 내용이 표시되었나요:

거기에 이 문제를 파악하기에 충분한 정보가 있을 것입니다.