2009-10-02 96 views
0

在OS X上工作,试图让Rails Exception Notifier插件发送电子邮件。我已经验证了以下情况:Rails例外通知程序插件的SMTP错误

  • 我能成功地从我的应用程序
  • 我(在我的行动之一1/0)创建一个测试错误发送电子邮件。
  • 安装当前插件...

    脚本/插件安装的git://github.com/rails/exception_notification.git

  • 在ApplicationController中......

    包括ExceptionNotifiable

    local_addresses.clear

  • 在environment.rb ...

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

除了故意创建的测试误差,我看到这个错误在控制台上...

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' 

然后试图发送一个异常通知的SMTP错误...

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

回答

2

This page似乎表明它与您的来自地址有关。尝试将其更改为[email protected]

+0

该页面还指出问题应该已经修复,但我在Rails 2.3.5中看到了同样的情况。删除尖括号可以解决问题。这仍然是坏的? – 2010-01-24 01:26:31