summaryrefslogtreecommitdiffstats
path: root/lib/tasks/email.rake
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-06-14 14:48:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-06-14 14:48:34 +0000
commitb3afde14fa6046a022eda73edee85ab48171909f (patch)
tree89dc8da3ab3f51ab9ed88fcc04e216822410aebe /lib/tasks/email.rake
parentc48193f8c113650c14d98b2f96279d57118df973 (diff)
downloadredmine-b3afde14fa6046a022eda73edee85ab48171909f.tar.gz
redmine-b3afde14fa6046a022eda73edee85ab48171909f.zip
Ability to accept incoming emails from unknown users (#2230, #3003).
An option lets you specify how to handle emails from unknown users: * ignore: the email is ignored (previous and default behaviour) * accept: the sender is considered as an anonymous user * create: a user account is created (username/password are sent back to the user) Permissions have to be consistent with the chosen option. Eg. if you choose 'create', the 'Non member' role must have the 'Add issues' permission so that an issue can be created by an unknown user via email. If you choose 'accept', the 'Anonymous' role must have this permission. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2789 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks/email.rake')
-rw-r--r--lib/tasks/email.rake18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake
index 0f74d6bd3..487ce506b 100644
--- a/lib/tasks/email.rake
+++ b/lib/tasks/email.rake
@@ -21,6 +21,13 @@ namespace :redmine do
desc <<-END_DESC
Read an email from standard input.
+General options:
+ unknown_user=ACTION how to handle emails from an unknown user
+ ACTION can be one of the following values:
+ ignore: email is ignored (default)
+ accept: accept as anonymous user
+ create: create a user account
+
Issue attributes control options:
project=PROJECT identifier of the target project
status=STATUS name of the target status
@@ -47,6 +54,7 @@ END_DESC
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']
MailHandler.receive(STDIN.read, options)
end
@@ -54,6 +62,13 @@ END_DESC
desc <<-END_DESC
Read emails from an IMAP server.
+General options:
+ unknown_user=ACTION how to handle emails from an unknown user
+ ACTION can be one of the following values:
+ ignore: email is ignored (default)
+ accept: accept as anonymous user
+ create: create a user account
+
Available IMAP options:
host=HOST IMAP server host (default: 127.0.0.1)
port=PORT IMAP server port (default: 143)
@@ -61,7 +76,7 @@ Available IMAP options:
username=USERNAME IMAP account
password=PASSWORD IMAP password
folder=FOLDER IMAP folder to read (default: INBOX)
-
+
Issue attributes control options:
project=PROJECT identifier of the target project
status=STATUS name of the target status
@@ -107,6 +122,7 @@ END_DESC
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']
Redmine::IMAP.check(imap_options, options)
end