exception_notification
exception_notification copied to clipboard
:sender_address in the examples can take to a SMTP error
Using :sender_address as specified in the examples:
ExceptionNotification.configure do |config|
# Email notifier sends notifications by email
config.add_notifier :email, {
:email_prefix => "[ERROR] ",
:sender_address => %{"Notifier" <[email protected]>},
:exception_recipients => %w{[email protected]}
}
end
I get this error:
.rbenv/versions/2.1.0-preview1/lib/ruby/2.1.0/net/smtp.rb:956:in `check_response': 501 Incorrect Address Format (Net::SMTPSyntaxError)
from .rbenv/versions/2.1.0-preview1/lib/ruby/2.1.0/net/smtp.rb:925:in `getok'
from .rbenv/versions/2.1.0-preview1/lib/ruby/2.1.0/net/smtp.rb:840:in `mailfrom'
from .rbenv/versions/2.1.0-preview1/lib/ruby/2.1.0/net/smtp.rb:661:in `send_message'
Changing :sender_address to %{<[email protected]>} fixes the error.
I don't know if the problem is related to Ruby 2.1.0 or to the SMTP server (I think it is related to the SMTP server because I tried with mailcatcher and it works), but maybe there could be some infos about this in the readme, maybe in a Troubleshooting section
Had to use :sender_address => %{Notifier <[email protected]>} instead of :sender_address => %{"Notifier" <[email protected]>} to make it work with Rails 4.2.4 and config.action_mailer.delivery_method = :sendmail.