Permalink
Browse files

Fixed that ActionMailer should send correctly formatted Return-Path i…

…n MAIL FROM for SMTP [#1842 state:committed]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information...
1 parent 5a8f764 commit 250dfb18afb58dda3caf4b9f170ddb9c5cf85faf @al2o3cr al2o3cr committed with dhh Feb 3, 2009
Showing with 7 additions and 1 deletion.
  1. +5 −0 actionmailer/CHANGELOG
  2. +1 −1 actionmailer/lib/action_mailer/base.rb
  3. +1 −0 actionmailer/test/mail_service_test.rb
View
@@ -1,3 +1,8 @@
+*Edge*
+
+* Fixed that ActionMailer should send correctly formatted Return-Path in MAIL FROM for SMTP #1842 [Matt Jones]
+
+
*2.3.0 [RC1] (February 1st, 2009)*
* Fixed RFC-2045 quoted-printable bug #1421 [squadette]
@@ -672,7 +672,7 @@ def create_mail
def perform_delivery_smtp(mail)
destinations = mail.destinations
mail.ready_to_send
- sender = mail['return-path'] || 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)
@@ -938,6 +938,7 @@ def test_return_path_with_deliver
ActionMailer::Base.delivery_method = :smtp
TestMailer.deliver_return_path
assert_match %r{^Return-Path: <another@somewhere.test>}, MockSMTP.deliveries[0][0]
+ assert_equal "another@somewhere.test", MockSMTP.deliveries[0][1].to_s
end
def test_body_is_stored_as_an_ivar

0 comments on commit 250dfb1

Please sign in to comment.