This project is archived and is in readonly mode.
ActionMailer doesn't correctly use return-path header
-
Chris Hapgood
Hmmmm. I just ran a test and can't see the double quotes. Yet I'm pretty sure I have seen them in the past.
My versions: Rails.version => 2.2.2 Net::SMTP::Revision => "11708"
-
Chris Hapgood
Whoops. I had the delivery method set to sendmail on my staging machine. As soon as a I set it to smtp, I do indeed see the double angle brackets around the return path address.
From my sendmail log:
Feb 3 13:24:56 osprey sendmail[30343]: n13IOuNd030343: from=<<bounces+chapgood@beta.racht.com>>, size=2379, class=0, nrcpts=1, msgid=<49888bf87ab8d_7684..fdbfb7b822e5@osprey.racht.com.tmail>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]Matt, I would suggest you upload a patch at a minimum. Testing it will indeed be a b!&%#.
+1 to fix this!
-
Matt Jones
- Tag changed from 2.3, actionmailer, bug to 2.3, actionmailer, bug, patch
Worked up a patch - given that Net::SMTP's behavior is known, I added an assertion to the existing Return-Path test to check the address is correctly formatted.
I recommend MailTrap to listen in on the SMTP conversation. Before the patch, the output (in mailtrap.output, not mailtrap.log) from a mailer that set the Return-Path:
Helo: EHLO example.com Seen an EHLO From: MAIL FROM:<<another@example.com>> To: RCPT TO:<somebody@example.com> + Return-Path: <another@example.com> + Date: Tue, 3 Feb 2009 14:34:23 -0500 + From: anybody@example.com + To: somebody@example.com + Message-Id: <49889c3f1cd8f_db11a37e3db@matt-jones-computer.local.tmail> + Subject: test mail + Mime-Version: 1.0 + Content-Type: text/plain; charset=utf-8 + + Blah blah blah!!! + Blah blah blah!!! + Blah blah blah!!! And we're done with that bozo!Note the extra brackets on the MAIL FROM line. The patch fixes it.
-
Repository
- State changed from new to committed
(from [250dfb18afb58dda3caf4b9f170ddb9c5cf85faf]) Fixed that ActionMailer should send correctly formatted Return-Path in MAIL FROM for SMTP [#1842 ActionMailer doesn't correctly use return-path header state:committed]
Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co...
-
Yar Dmitriev
Rails 2.3.8, production mode
config.action_mailer.delivery_method = :sendmail
An attempt to specify:
headers "return-path" => "user@domain.tld"
results in the envelope-from value being <user@domain.tld>, which cases the message to be bounced back.
The patch is attached.
-
Yar Dmitriev
Of course, I meant double angular brackets - the parser shows them as singular here.
