@@ -1,4 +1,4 | |||
|
1 |
# |
|
|
1 | # Redmine - project management software | |
|
2 | 2 | # Copyright (C) 2006-2008 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
@@ -33,9 +33,18 module Redmine | |||
|
33 | 33 | msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822'] |
|
34 | 34 | logger.debug "Receiving message #{message_id}" if logger && logger.debug? |
|
35 | 35 | if MailHandler.receive(msg, options) |
|
36 | logger.debug "Message #{message_id} successfully received" if logger && logger.debug? | |
|
37 | if imap_options[:move_on_success] | |
|
38 | imap.copy(message_id, imap_options[:move_on_success]) | |
|
39 | end | |
|
36 | 40 | imap.store(message_id, "+FLAGS", [:Seen, :Deleted]) |
|
37 | 41 | else |
|
42 | logger.debug "Message #{message_id} can not be processed" if logger && logger.debug? | |
|
38 | 43 | imap.store(message_id, "+FLAGS", [:Seen]) |
|
44 | if imap_options[:move_on_failure] | |
|
45 | imap.copy(message_id, imap_options[:move_on_failure]) | |
|
46 | imap.store(message_id, "+FLAGS", [:Deleted]) | |
|
47 | end | |
|
39 | 48 | end |
|
40 | 49 | end |
|
41 | 50 | imap.expunge |
@@ -1,4 +1,4 | |||
|
1 |
# |
|
|
1 | # Redmine - project management software | |
|
2 | 2 | # Copyright (C) 2006-2008 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
@@ -72,6 +72,11 Issue attributes control options: | |||
|
72 | 72 | specified by previous options |
|
73 | 73 | ATTRS is a comma separated list of attributes |
|
74 | 74 | |
|
75 | Processed emails control options: | |
|
76 | move_on_success=MAILBOX move emails that were successfully received | |
|
77 | to MAILBOX instead of deleting them | |
|
78 | move_on_failure=MAILBOX move emails that were ignored to MAILBOX | |
|
79 | ||
|
75 | 80 | Examples: |
|
76 | 81 | # No project specified. Emails MUST contain the 'Project' keyword: |
|
77 | 82 | |
@@ -95,7 +100,9 END_DESC | |||
|
95 | 100 | :ssl => ENV['ssl'], |
|
96 | 101 | :username => ENV['username'], |
|
97 | 102 | :password => ENV['password'], |
|
98 |
:folder => ENV['folder'] |
|
|
103 | :folder => ENV['folder'], | |
|
104 | :move_on_success => ENV['move_on_success'], | |
|
105 | :move_on_failure => ENV['move_on_failure']} | |
|
99 | 106 | |
|
100 | 107 | options = { :issue => {} } |
|
101 | 108 | %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } |
General Comments 0
You need to be logged in to leave comments.
Login now