Hi @Andro
In Discourse, the Rails Action Mailer sends the mail, after being scheduled as a Sidekiq job.
Normally, some Job exception errors are logged in the Rails production log, for example.
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
Hence, you may be able to find some clues in your Rails production log, as illustrated above.
Cheers and hope this helps.
PS: Another small thing to check and maybe not useful in your use case, is to run from the Rails console:
EmailLog.where(bounced:true).count
or even more simply:
EmailLog.bounced.count
Also, I forgot to mention, you can configure Rails to log more mailer information if you need more logging:
There are a number of settings available on config.action_mailer:
config.action_mailer.logger accepts a logger conforming to the interface of Log4r or the default Ruby Logger class, which is then used to log information from Action Mailer. Set to nil to disable logging.
Discourse, OOTB, this is set to nil
, not logging:
[5] pry(main)> Rails.application.config.action_mailer.logger
=> nil
See, for example, section 3.10 Configuring Action Mailer
https://guides.rubyonrails.org/v4.0.1/configuring.html