Permalink
Browse files

Revert "1.9 compatibility - don't pass an array as the from address a…

…s this ends up generating invalid SMTP commands."

This change broke our SMTP sends because mail['from'] is the full From:
line (e.g. "\"Econsultancy [Admin]\" <no-reply@econsultancy.com>")
instead of just the address (e.g. "no-reply@econsultancy.com"); SMTP's
MAIL FROM command requires the latter.

This reverts commit 72d111a.
  • Loading branch information...
1 parent 12c02fe commit e12d7e1acdaa580cd7933e8ac6f4d31d52d87ecd @tomstuart tomstuart committed Jul 13, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionmailer/lib/action_mailer/base.rb
@@ -674,7 +674,7 @@ def create_mail
def perform_delivery_smtp(mail)
destinations = mail.destinations
mail.ready_to_send
- sender = (mail['return-path'] && mail['return-path'].spec) || mail['from']
+ sender = (mail['return-path'] && mail['return-path'].spec) || mail.from
smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto)

0 comments on commit e12d7e1

Please sign in to comment.