diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-26 18:30:24 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-26 18:30:24 +0000 |
commit | 8531e176aab6e3f4b6805aaa19af0b257b6cafb2 (patch) | |
tree | 426c89facea46b4a74161304c9007a614c72f21c /app | |
parent | 328df74dd1779963b80317b72e56aa2a4ea5e2f2 (diff) | |
download | redmine-8531e176aab6e3f4b6805aaa19af0b257b6cafb2.tar.gz redmine-8531e176aab6e3f4b6805aaa19af0b257b6cafb2.zip |
Do not send an email with no recipient, cc or bcc (closes #743).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1174 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/mailer.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 75a2e960b..ad5a3647b 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -122,7 +122,16 @@ class Mailer < ActionMailer::Base subject 'Redmine test' body :url => url_for(:controller => 'welcome') end - + + # Overrides default deliver! method to prevent from sending an email + # with no recipient, cc or bcc + def deliver!(mail = @mail) + return false if (recipients.nil? || recipients.empty?) && + (cc.nil? || cc.empty?) && + (bcc.nil? || bcc.empty?) + super + end + private def initialize_defaults(method_name) super |