summaryrefslogtreecommitdiffstats
path: root/extra/mail_handler/rdm-mailhandler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'extra/mail_handler/rdm-mailhandler.rb')
-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}..."