简体   繁体   中英

SMTP error with Rails Exception Notifier plugin

Working on OS X, trying to get Rails Exception Notifier plugin to send out emails. I have verified the following:

  • I can successfully send email from my app
  • I am creating a test error ( 1/0 in one of my actions).
  • Current plugin installed...

    script/plugin install git://github.com/rails/exception_notification.git

  • In ApplicationController...

    include ExceptionNotifiable

    local_addresses.clear

  • In environment.rb...

     Rails::Initializer.run do |config| # ... config.after_initialize do ExceptionNotifier.exception_recipients = %w(abc@gmail.com abc@abc.gov) ExceptionNotifier.sender_address = %("Contact DB error" <abc@abc.gov>) ExceptionNotifier.email_prefix = "[Contact DB error] " end end 

In addition to the intentionally-created test error, I'm seeing this error on the console...

    Processing ApplicationController#index (for 127.0.0.1 at 2009-10-02 14:40:55) [GET]

    Net::SMTPFatalError (555 5.5.2 Syntax error. 3sm30577fge.12
    ):
      /usr/local/lib/ruby/1.8/net/smtp.rb:680:in `check_response'
      /usr/local/lib/ruby/1.8/net/smtp.rb:653:in `getok'
      /usr/local/lib/ruby/1.8/net/smtp.rb:631:in `mailfrom'
      /usr/local/lib/ruby/1.8/net/smtp.rb:544:in `send0'
      /usr/local/lib/ruby/1.8/net/smtp.rb:472:in `sendmail'
      /usr/local/lib/ruby/1.8/net/smtp.rb:379:in `start'
      haml (2.2.6) rails/./lib/sass/plugin/rails.rb:19:in `process'

Then it tries to send an exception notification for the SMTP error...

  Subject: [Contact DB error] application#index (Net::SMTPFatalError) "555 5.5.2 Syntax error. 3sm30577fge.12\n"

This page seems to indicate it is related to your from address. Try changing it to just abc@abc.gov .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM