Mercurial > hg > soundsoftware-site
comparison lib/tasks/email.rake @ 1295:622f24f53b42 redmine-2.3
Update to Redmine SVN revision 11972 on 2.3-stable branch
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:02:21 +0100 |
parents | 433d4f72a19b |
children |
comparison
equal
deleted
inserted
replaced
1294:3e4c3460b6ca | 1295:622f24f53b42 |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2012 Jean-Philippe Lang | 2 # Copyright (C) 2006-2013 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
27 ignore: email is ignored (default) | 27 ignore: email is ignored (default) |
28 accept: accept as anonymous user | 28 accept: accept as anonymous user |
29 create: create a user account | 29 create: create a user account |
30 no_permission_check=1 disable permission checking when receiving | 30 no_permission_check=1 disable permission checking when receiving |
31 the email | 31 the email |
32 no_account_notice=1 disable new user account notification | |
33 default_group=foo,bar adds created user to foo and bar groups | |
32 | 34 |
33 Issue attributes control options: | 35 Issue attributes control options: |
34 project=PROJECT identifier of the target project | 36 project=PROJECT identifier of the target project |
35 status=STATUS name of the target status | 37 status=STATUS name of the target status |
36 tracker=TRACKER name of the target tracker | 38 tracker=TRACKER name of the target tracker |
56 options = { :issue => {} } | 58 options = { :issue => {} } |
57 %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } | 59 %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } |
58 options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] | 60 options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
59 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] | 61 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
60 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] | 62 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
63 options[:no_account_notice] = ENV['no_account_notice'] if ENV['no_account_notice'] | |
64 options[:default_group] = ENV['default_group'] if ENV['default_group'] | |
61 | 65 |
62 MailHandler.receive(STDIN.read, options) | 66 MailHandler.receive(STDIN.read, options) |
63 end | 67 end |
64 | 68 |
65 desc <<-END_DESC | 69 desc <<-END_DESC |
71 ignore: email is ignored (default) | 75 ignore: email is ignored (default) |
72 accept: accept as anonymous user | 76 accept: accept as anonymous user |
73 create: create a user account | 77 create: create a user account |
74 no_permission_check=1 disable permission checking when receiving | 78 no_permission_check=1 disable permission checking when receiving |
75 the email | 79 the email |
80 no_account_notice=1 disable new user account notification | |
81 default_group=foo,bar adds created user to foo and bar groups | |
76 | 82 |
77 Available IMAP options: | 83 Available IMAP options: |
78 host=HOST IMAP server host (default: 127.0.0.1) | 84 host=HOST IMAP server host (default: 127.0.0.1) |
79 port=PORT IMAP server port (default: 143) | 85 port=PORT IMAP server port (default: 143) |
80 ssl=SSL Use SSL? (default: false) | 86 ssl=SSL Use SSL? (default: false) |
127 options = { :issue => {} } | 133 options = { :issue => {} } |
128 %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } | 134 %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } |
129 options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] | 135 options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
130 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] | 136 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
131 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] | 137 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
138 options[:no_account_notice] = ENV['no_account_notice'] if ENV['no_account_notice'] | |
139 options[:default_group] = ENV['default_group'] if ENV['default_group'] | |
132 | 140 |
133 Redmine::IMAP.check(imap_options, options) | 141 Redmine::IMAP.check(imap_options, options) |
134 end | 142 end |
135 | 143 |
136 desc <<-END_DESC | 144 desc <<-END_DESC |
160 options = { :issue => {} } | 168 options = { :issue => {} } |
161 %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } | 169 %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } |
162 options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] | 170 options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
163 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] | 171 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
164 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] | 172 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
173 options[:no_account_notice] = ENV['no_account_notice'] if ENV['no_account_notice'] | |
174 options[:default_group] = ENV['default_group'] if ENV['default_group'] | |
165 | 175 |
166 Redmine::POP3.check(pop_options, options) | 176 Redmine::POP3.check(pop_options, options) |
167 end | 177 end |
168 | 178 |
169 desc "Send a test email to the user with the provided login name" | 179 desc "Send a test email to the user with the provided login name" |