Mercurial > hg > soundsoftware-site
diff lib/tasks/email.rake @ 1525:fb9a13467253 live
Merge from branch redmine-2.5-integration
author | Chris Cannam |
---|---|
date | Thu, 11 Sep 2014 12:45:02 +0100 |
parents | e248c7af89ec |
children |
line wrap: on
line diff
--- a/lib/tasks/email.rake Wed May 07 14:15:02 2014 +0100 +++ b/lib/tasks/email.rake Thu Sep 11 12:45:02 2014 +0100 @@ -1,5 +1,5 @@ # Redmine - project management software -# Copyright (C) 2006-2012 Jean-Philippe Lang +# Copyright (C) 2006-2014 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -29,6 +29,8 @@ create: create a user account no_permission_check=1 disable permission checking when receiving the email + no_account_notice=1 disable new user account notification + default_group=foo,bar adds created user to foo and bar groups Issue attributes control options: project=PROJECT identifier of the target project @@ -53,13 +55,7 @@ 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'] - - MailHandler.receive(STDIN.read, options) + MailHandler.receive(STDIN.read, MailHandler.extract_options_from_env(ENV)) end desc <<-END_DESC @@ -73,6 +69,8 @@ create: create a user account no_permission_check=1 disable permission checking when receiving the email + no_account_notice=1 disable new user account notification + default_group=foo,bar adds created user to foo and bar groups Available IMAP options: host=HOST IMAP server host (default: 127.0.0.1) @@ -124,13 +122,7 @@ :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'] - - Redmine::IMAP.check(imap_options, options) + Redmine::IMAP.check(imap_options, MailHandler.extract_options_from_env(ENV)) end desc <<-END_DESC @@ -157,13 +149,7 @@ :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'] - - 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"