How to see full log detail not truncated

Suddenly all my maill is bouncing. I need to have the full log detail. The view Discourse shows is truncated with an ellipsis. How can I see the whole entry? It’s urgently needed to help solve this.

Reporting-MTA: dsn; a27-22.smtp-out.us-west-2.amazonses.com

Action: failed
Final-Recipient: rfc822; keith.jones@du.edu
Diagnostic-Code: smtp; 554 Blocked - see Home | Proofpoint Dynamic Reputation - IP Lookup
Sta…

You need to see the logs of your mail server. It looks like discourse is delivering mail but that the mail server doesn’t want to deliver it.

1 Like

I am lost here. I use Amazon SES for mail. Logged in to bash in the container, I don’t know where to find Discourse logs for mail. I am unable to see anything relevant in /var/log. Apologies for being a complete ignoramus. I was at least able to see the logs at the /logs URL for Discourse, but why cant I find this on disk. Are they in a database?

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

1 Like

Problem is, we are using Amazon Simple Email Service (SES) and I am unable to find any way to view logs there. I think logs are simply not available as part of the service.

Hello @neounix, thanks so much. I am able to see full mail details in the dated production.log files. I can see the full response from Amazon SES. This is exactly what I need. So helpful. Most appreciated.

2 Likes

Dear @Andro

You are so welcome. Glad to have been able to help you get to the root of your problem.

Happy Holidays and Onwards and Upwards!

1 Like