From 130d32b875b448e8f2aadfba9c0dcd2923f62fa7 Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Fri, 4 Dec 2009 00:33:31 +0000 Subject: Make fix for return path when using sendmail have test --- lib/sendmail_return_path.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/sendmail_return_path.rb (limited to 'lib') diff --git a/lib/sendmail_return_path.rb b/lib/sendmail_return_path.rb new file mode 100644 index 000000000..f9ddba5b4 --- /dev/null +++ b/lib/sendmail_return_path.rb @@ -0,0 +1,21 @@ +# Monkeypatch! +# Grrr, semantics of smtp and sendmail send should be the same with regard to setting return path + +# See test in spec/lib/sendmail_return_path.rb + +module ActionMailer + class Base + def perform_delivery_sendmail(mail) + sender = (mail['return-path'] && mail['return-path'].spec) || mail.from + + sendmail_args = sendmail_settings[:arguments].dup + sendmail_args += " -f \"#{sender}\"" + + IO.popen("#{sendmail_settings[:location]} #{sendmail_args}","w+") do |sm| + sm.print(mail.encoded.gsub(/\r/, '')) + sm.flush + end + end + end +end + -- cgit v1.2.3