summaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-19 14:08:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-19 14:08:48 +0000
commit06ca18b04225a68769ab742900ec74ce776c2e86 (patch)
tree72db2b3b95bd049da95e0f257ec77514d835f099 /extra
parent9d120c872c1b5849d987e3950f2cf914e1e34fe2 (diff)
downloadredmine-06ca18b04225a68769ab742900ec74ce776c2e86.tar.gz
redmine-06ca18b04225a68769ab742900ec74ce776c2e86.zip
Adds a 'no_permission_check' option to the MailHandler.
Used with the 'project' option, it allows anyone to submit emails to a private inbox project (#4407). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3195 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'extra')
-rw-r--r--extra/mail_handler/rdm-mailhandler.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/extra/mail_handler/rdm-mailhandler.rb b/extra/mail_handler/rdm-mailhandler.rb
index 91bb771b9..fe9460a6b 100644
--- a/extra/mail_handler/rdm-mailhandler.rb
+++ b/extra/mail_handler/rdm-mailhandler.rb
@@ -20,6 +20,8 @@
# ignore: email is ignored (default)
# accept: accept as anonymous user
# create: create a user account
+# --no-permission-check disable permission checking when receiving
+# the email
# -h, --help show this help
# -v, --verbose show extra information
# -V, --version show version information and exit
@@ -69,7 +71,7 @@ end
class RedmineMailHandler
VERSION = '0.1'
- attr_accessor :verbose, :issue_attributes, :allow_override, :unknown_user, :url, :key
+ attr_accessor :verbose, :issue_attributes, :allow_override, :unknown_user, :no_permission_check, :url, :key
def initialize
self.issue_attributes = {}
@@ -86,7 +88,8 @@ class RedmineMailHandler
[ '--category', GetoptLong::REQUIRED_ARGUMENT],
[ '--priority', GetoptLong::REQUIRED_ARGUMENT],
[ '--allow-override', '-o', GetoptLong::REQUIRED_ARGUMENT],
- [ '--unknown-user', GetoptLong::REQUIRED_ARGUMENT]
+ [ '--unknown-user', GetoptLong::REQUIRED_ARGUMENT],
+ [ '--no-permission-check', GetoptLong::NO_ARGUMENT]
)
opts.each do |opt, arg|
@@ -107,6 +110,8 @@ class RedmineMailHandler
self.allow_override = arg.dup
when '--unknown-user'
self.unknown_user = arg.dup
+ when '--no-permission-check'
+ self.no_permission_check = '1'
end
end
@@ -118,7 +123,8 @@ class RedmineMailHandler
data = { 'key' => key, 'email' => email,
'allow_override' => allow_override,
- 'unknown_user' => unknown_user }
+ 'unknown_user' => unknown_user,
+ 'no_permission_check' => no_permission_check}
issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value }
debug "Posting to #{uri}..."