diff options
author | francis <francis> | 2008-09-04 08:37:26 +0000 |
---|---|---|
committer | francis <francis> | 2008-09-04 08:37:26 +0000 |
commit | bc25f87cb0e204b00f1ef6e4cf4dc249643437d3 (patch) | |
tree | 51f33a31be0ae81722f836509f597ade5737abf9 /config/environment.rb | |
parent | 42a33a9947e3db4398bfe5cf79b04822d4886857 (diff) |
Hooray, one less monkeypatch makes the world a better place.
Diffstat (limited to 'config/environment.rb')
-rw-r--r-- | config/environment.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/config/environment.rb b/config/environment.rb index 771d5e5b6..66bf33e77 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -94,39 +94,6 @@ end # Domain for URLs (so can work for scripts, not just web pages) ActionController::UrlWriter.default_url_options[:host] = MySociety::Config.get("DOMAIN", 'localhost:3000') -# Monkeypatch! Set envelope from in ActionMailer. Code mostly taken from this -# Rails patch, with addition of using mail.from for sendmail if sender not set -# (the patch does that only for SMTP, when it clearly should consistently do it -# for both) -# http://dev.rubyonrails.org/attachment/ticket/7697/action_mailer_base_sender.diff -# Which is part of this ticket: -# http://dev.rubyonrails.org/ticket/7697 -module ActionMailer - class Base - def perform_delivery_smtp(mail) - destinations = mail.destinations - sender = mail.sender(nil) || mail.from - mail.ready_to_send - - Net::SMTP.start(smtp_settings[:address], smtp_settings[:port], smtp_settings[:domain], - smtp_settings[:user_name], smtp_settings[:password], smtp_settings[:authentication]) do |smtp| - smtp.sendmail(mail.encoded, sender, destinations) - end - end - - def perform_delivery_sendmail(mail) - sender = mail.sender(nil) || mail.from - - arguments = sendmail_settings[:arguments].dup - arguments += " -f \"#{sender}\"" - IO.popen("#{sendmail_settings[:location]} #{arguments}","w+") do |sm| - sm.print(mail.encoded.gsub(/\r/, '')) - sm.flush - end - end - end -end - # Monkeypatch! Method to remove individual error messages from an ActiveRecord. module ActiveRecord class Errors |