여기서 완전히 길을 잃었습니다. 메일 발송에는 Amazon SES를 사용하고 있습니다. 컨테이너에 bash로 로그인했지만, 메일 관련 Discourse 로그를 어디서 찾아야 할지 모르겠습니다. /var/log 디렉터리에서도 관련 내용을 전혀 찾을 수 없습니다. 아무것도 모르고 질문드려 죄송합니다. 적어도 Discourse의 /logs URL에서는 로그를 볼 수 있었는데, 왜 디스크에서는 찾을 수 없는지 궁금합니다. 데이터베이스에 저장되어 있는 걸까요?
Discourse에서는 Rails Action Mailer가 메일을 Sidekiq 작업으로 예약된 후 전송합니다.
보통 작업 예외(Job exception) 오류는 Rails production 로그에 기록됩니다. 예를 들어 다음과 같습니다.
linux# docker exec -it your-app bash
your-app:/# cd /shared/log/rails
your-app:/shared/log/rails# grep -i SMTP *
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. m7sm3825233oou.11 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. 63sm3561399otx.2 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. z63sm4258403otb.20 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. q18sm3815880ood.35 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. h2sm4265076otn.15 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. y84sm4346372oig.36 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. 8sm4343514oii.45 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. t18sm722516otc.64 - gsmtp
production.log-20201215:Job exception: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. j22sm1840062otp.45 - gsmtp
따라서 위와 같이 Rails production 로그에서 몇 가지 단서를 찾을 수 있을 것입니다.
감사합니다. 도움이 되길 바랍니다.
PS: 당신의 사용 사례에는 유용하지 않을 수도 있지만, 확인해 볼 수 있는 또 다른 작은 사항은 Rails 콘솔에서 다음을 실행하는 것입니다:
EmailLog.where(bounced:true).count
또는 더 간단하게:
EmailLog.bounced.count
또한, 더 많은 로깅이 필요하면 Rails를 설정하여 더 많은 메일러 정보를 기록할 수 있다는 것을 잊고 있었습니다:
config.action_mailer에는 사용할 수 있는 설정이 여러 가지 있습니다:
config.action_mailer.logger는 Log4r 인터페이스나 기본 Ruby Logger 클래스의 인터페이스에 부합하는 로거를 받아, Action Mailer에서 정보를 기록하는 데 사용됩니다. 로깅을 비활성화하려면 nil로 설정합니다.
Discourse의 기본 설정(OOTB)에서는 이것이 nil로 설정되어 있어 로깅이 되지 않습니다:
@neounix님, 안녕하세요. 정말 감사합니다. 날짜가 표시된 production.log 파일에서 이메일의 전체 세부 정보를 확인할 수 있습니다. Amazon SES에서 반환된 전체 응답도 볼 수 있습니다. 바로 제가 필요로 했던 것이었습니다. 정말 큰 도움이 되었습니다. 진심으로 감사드립니다.