Skip to content

Commit

Permalink
1.9 compatibility - don't pass an array as the from address as this e…
Browse files Browse the repository at this point in the history
…nds up generating invalid SMTP commands.
  • Loading branch information
Friedrich Göpel authored and NZKoz committed Jun 9, 2009
1 parent 74c1249 commit 1d57ccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionmailer/lib/action_mailer/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,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)
Expand Down

2 comments on commit 1d57ccb

@travissinnott
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks compatibility with Ruby 1.8 when the from address has a display name included (eg. "My Name name@address.tld")

@travissinnott
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should read: "My Name <name@address.tld>"

Please sign in to comment.