I have a method in a model which processes an incoming bounced email. In cPanel, I have an email account forwarder called eblast-bounce@mydomain.com which is set to pipe to a program with the line
|/home/myaccount/my_rails_app/production/script/runner
'EBlast.receive(STDIN.read)' -e production`
The problem is that the entire contents of STDIN.read is dumped in the log. I don’t want any of that. It gets dumped before the EBlast.receive method is even called because I put a custom log entry on the first line of that method and the email contents are logged before that is.
How do I stop STDIN.read from being logged? It’s blowing up my log file.
EDIT: Maybe it isn’t something that the script/runner is doing, but rather what mail server is doing somehow? I noticed that in my logs whenever I actually send AND receive the emails through the rails app, the email contents are logged. When the email is sent,
Sent mail to [email address]
appears before the email contents…when I receive an email through script/runner,
Received mail:
appears before the email contents.
Turns out it has to do with the logger function of action_mailer! I put
ActionMailer::Base.logger = nilin environment.rbProblem solved.