diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-04 07:32:35 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-04 07:32:35 +0000 |
commit | ed18b3359b6d4fc4b9a8d81c310a6bf8d01ef9ce (patch) | |
tree | c9aa4a39d69bc46f6c1aff322a27a7fc9058d953 /lib/tasks | |
parent | 33afeea87a005ad815918db995ed92075b67829d (diff) | |
download | redmine-ed18b3359b6d4fc4b9a8d81c310a6bf8d01ef9ce.tar.gz redmine-ed18b3359b6d4fc4b9a8d81c310a6bf8d01ef9ce.zip |
Adds a method for extracting MailHandler options from ENV.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11785 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/email.rake | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake index 934070e54..596b086d2 100644 --- a/lib/tasks/email.rake +++ b/lib/tasks/email.rake @@ -55,15 +55,7 @@ Examples: END_DESC task :read => :environment do - options = { :issue => {} } - %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } - options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] - options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] - options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] - options[:no_account_notice] = ENV['no_account_notice'] if ENV['no_account_notice'] - options[:default_group] = ENV['default_group'] if ENV['default_group'] - - MailHandler.receive(STDIN.read, options) + MailHandler.receive(STDIN.read, MailHandler.extract_options_from_env(ENV)) end desc <<-END_DESC @@ -130,15 +122,7 @@ END_DESC :move_on_success => ENV['move_on_success'], :move_on_failure => ENV['move_on_failure']} - options = { :issue => {} } - %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } - options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] - options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] - options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] - options[:no_account_notice] = ENV['no_account_notice'] if ENV['no_account_notice'] - options[:default_group] = ENV['default_group'] if ENV['default_group'] - - Redmine::IMAP.check(imap_options, options) + Redmine::IMAP.check(imap_options, MailHandler.extract_options_from_env(ENV)) end desc <<-END_DESC @@ -165,15 +149,7 @@ END_DESC :password => ENV['password'], :delete_unprocessed => ENV['delete_unprocessed']} - options = { :issue => {} } - %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } - options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] - options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] - options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] - options[:no_account_notice] = ENV['no_account_notice'] if ENV['no_account_notice'] - options[:default_group] = ENV['default_group'] if ENV['default_group'] - - Redmine::POP3.check(pop_options, options) + Redmine::POP3.check(pop_options, MailHandler.extract_options_from_env(ENV)) end desc "Send a test email to the user with the provided login name" |