diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index be260b4..45a20bf 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -86,6 +86,7 @@ class AdminController < ApplicationController @flags = { :default_admin_changed => User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?, :file_repository_writable => File.writable?(Attachment.storage_path), + :plugin_assets_writable => File.writable?(Engines.public_directory), :rmagick_available => Object.const_defined?(:Magick) } end diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 7d89e21..e8d0a85 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -175,6 +175,7 @@ class ApplicationController < ActionController::Base # TODO: move to model def attach_files(obj, attachments) attached = [] + unsaved = [] if attachments && attachments.is_a?(Hash) attachments.each_value do |attachment| file = attachment['file'] @@ -183,7 +184,10 @@ class ApplicationController < ActionController::Base :file => file, :description => attachment['description'].to_s.strip, :author => User.current) - attached << a unless a.new_record? + a.new_record? ? (unsaved << a) : (attached << a) + end + if unsaved.any? + flash[:warning] = l(:warning_attachments_not_saved, unsaved.size) end end attached diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a935ce9..35d1670 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -147,6 +147,15 @@ module ApplicationHelper end content end + + # Renders flash messages + def render_flash_messages + s = '' + flash.each do |k,v| + s << content_tag('div', v, :class => "flash #{k}") + end + s + end # Truncates and returns the string as a single line def truncate_single_line(string, *args) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index dd4b5be..9a0f3a5 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -40,6 +40,7 @@ class Mailer < ActionMailer::Base 'Issue-Id' => issue.id, 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to + @author = journal.user recipients issue.recipients # Watchers in cc cc(issue.watcher_recipients - @recipients) @@ -209,9 +210,10 @@ class Mailer < ActionMailer::Base def create_mail # Removes the current user from the recipients and cc # if he doesn't want to receive notifications about what he does - if User.current.pref[:no_self_notified] - recipients.delete(User.current.mail) if recipients - cc.delete(User.current.mail) if cc + @author ||= User.current + if @author.pref[:no_self_notified] + recipients.delete(@author.mail) if recipients + cc.delete(@author.mail) if cc end # Blind carbon copy recipients if Setting.bcc_recipients? diff --git a/app/models/project.rb b/app/models/project.rb index e8d3ed1..c792b9c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -60,7 +60,7 @@ class Project < ActiveRecord::Base validates_associated :repository, :wiki validates_length_of :name, :maximum => 30 validates_length_of :homepage, :maximum => 255 - validates_length_of :identifier, :in => 3..20 + validates_length_of :identifier, :in => 2..20 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/ before_destroy :delete_all_members diff --git a/app/views/admin/info.rhtml b/app/views/admin/info.rhtml index 1417468..8c126b5 100644 --- a/app/views/admin/info.rhtml +++ b/app/views/admin/info.rhtml @@ -4,7 +4,8 @@
<%= l(:text_default_administrator_account_changed) %> | <%= image_tag (@flags[:default_admin_changed] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %> |
<%= l(:text_file_repository_writable) %> | <%= image_tag (@flags[:file_repository_writable] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %> |
<%= l(:text_file_repository_writable) %> (<%= Attachment.storage_path %>) | <%= image_tag (@flags[:file_repository_writable] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %> |
<%= l(:text_plugin_assets_writable) %> (<%= Engines.public_directory %>) | <%= image_tag (@flags[:plugin_assets_writable] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %> |
<%= l(:text_rmagick_available) %> | <%= image_tag (@flags[:rmagick_available] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %> |
<%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %>
<%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %>
<% unless @project.identifier_frozen? %>
-
<%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %>
+
<%= l(:text_length_between, 2, 20) %> <%= l(:text_project_identifier_info) %>
<% end %>
<%= f.text_field :homepage, :size => 60 %>
<%= f.check_box :is_public %>
diff --git a/lang/bg.yml b/lang/bg.yml index 5170a97..df18690 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -696,3 +696,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ca.yml b/lang/ca.yml index 7939807..d0d6b82 100644 --- a/lang/ca.yml +++ b/lang/ca.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/cs.yml b/lang/cs.yml index ba22ab1..16fde62 100644 --- a/lang/cs.yml +++ b/lang/cs.yml @@ -701,3 +701,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/da.yml b/lang/da.yml index 5b8ee5b..8f1049d 100644 --- a/lang/da.yml +++ b/lang/da.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/de.yml b/lang/de.yml index 517bc3a..4697aae 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -698,3 +698,5 @@ default_activity_development: Entwicklung enumeration_issue_priorities: Ticket-Prioritäten enumeration_doc_categories: Dokumentenkategorien enumeration_activities: Aktivitäten (Zeiterfassung) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/en.yml b/lang/en.yml index b2d7efc..9bd56e8 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -85,6 +85,8 @@ error_scm_command_failed: "An error occurred when trying to access the repositor error_scm_annotate: "The entry does not exist or can not be annotated." error_issue_not_found_in_project: 'The issue was not found or does not belong to this project' +warning_attachments_not_saved: "%d file(s) could not be saved." + mail_subject_lost_password: Your %s password mail_body_lost_password: 'To change your password, click on the following link:' mail_subject_register: Your %s account activation @@ -660,7 +662,8 @@ text_status_changed_by_changeset: Applied in changeset %s. text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s) ?' text_select_project_modules: 'Select modules to enable for this project:' text_default_administrator_account_changed: Default administrator account changed -text_file_repository_writable: File repository writable +text_file_repository_writable: Attachments directory writable +text_plugin_assets_writable: Plugin assets directory writable text_rmagick_available: RMagick available (optional) text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ? text_destroy_time_entries: Delete reported hours diff --git a/lang/es.yml b/lang/es.yml index 8437bec..83c51e6 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -681,3 +681,5 @@ text_user_mail_option: "De los proyectos no seleccionados, sólo recibirá notif text_user_wrote: '%s escribió:' text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su contenido? text_workflow_edit: Seleccionar un flujo de trabajo para actualizar +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/fi.yml b/lang/fi.yml index be0a46b..2363386 100644 --- a/lang/fi.yml +++ b/lang/fi.yml @@ -696,3 +696,5 @@ label_user_activity: "Käyttäjän %s historia" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/fr.yml b/lang/fr.yml index 9d02300..c3210a5 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -85,6 +85,8 @@ error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt error_scm_annotate: "L'entrée n'existe pas ou ne peut pas être annotée." error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas à ce projet" +warning_attachments_not_saved: "%d fichier(s) n'ont pas pu être sauvegardés." + mail_subject_lost_password: Votre mot de passe %s mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant:' mail_subject_register: Activation de votre compte %s @@ -661,6 +663,7 @@ text_issues_destroy_confirmation: 'Etes-vous sûr de vouloir supprimer le(s) dem text_select_project_modules: 'Selectionner les modules à activer pour ce project:' text_default_administrator_account_changed: Compte administrateur par défaut changé text_file_repository_writable: Répertoire de stockage des fichiers accessible en écriture +text_plugin_assets_writable: Répertoire public des plugins accessible en écriture text_rmagick_available: Bibliothèque RMagick présente (optionnelle) text_destroy_time_entries_question: %.02f heures ont été enregistrées sur les demandes à supprimer. Que voulez-vous faire ? text_destroy_time_entries: Supprimer les heures diff --git a/lang/he.yml b/lang/he.yml index 6066bee..617b3ac 100644 --- a/lang/he.yml +++ b/lang/he.yml @@ -694,3 +694,7 @@ permission_edit_own_messages: ערוך הודעות של עצמך permission_delete_own_messages: מחק הודעות של עצמך label_user_activity: "הפעילות של %s" label_updated_time_by: עודכן ע"י %s לפני %s +setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/hu.yml b/lang/hu.yml index 170c695..1768ced 100644 --- a/lang/hu.yml +++ b/lang/hu.yml @@ -697,3 +697,5 @@ label_user_activity: "%s tevékenységei" label_updated_time_by: "Módosította %s ennyivel ezelőtt: %s" text_diff_truncated: '... A diff fájl vége nem jelenik meg, mert hosszab, mint a megjeleníthető sorok száma.' setting_diff_max_lines_displayed: A megjelenítendő sorok száma (maximum) a diff fájloknál +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/it.yml b/lang/it.yml index c5efcb2..134096b 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -696,3 +696,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ja.yml b/lang/ja.yml index e1dfa2d..2ca1a4e 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ko.yml b/lang/ko.yml index 6d1f119..cc072e1 100644 --- a/lang/ko.yml +++ b/lang/ko.yml @@ -696,3 +696,5 @@ label_user_activity: "%s의 작업내역" label_updated_time_by: %s가 %s 전에 변경 text_diff_truncated: '... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.' setting_diff_max_lines_displayed: 차이점보기에 표시할 최대 줄수 +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/lt.yml b/lang/lt.yml index e8d663d..ef2978e 100644 --- a/lang/lt.yml +++ b/lang/lt.yml @@ -698,3 +698,5 @@ default_activity_development: Vystymas enumeration_issue_priorities: Darbo prioritetai enumeration_doc_categories: Dokumento kategorijos enumeration_activities: Veiklos (laiko sekimas) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/nl.yml b/lang/nl.yml index 51b91a1..bbffbf1 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -698,3 +698,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/no.yml b/lang/no.yml index 8cf2321..9d0ccc9 100644 --- a/lang/no.yml +++ b/lang/no.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/pl.yml b/lang/pl.yml index f42a8d2..9742e19 100644 --- a/lang/pl.yml +++ b/lang/pl.yml @@ -715,3 +715,5 @@ label_user_activity: "Aktywność: %s" label_updated_time_by: Uaktualnione przez %s %s temu text_diff_truncated: '... Ten plik różnic został przycięty ponieważ jest zbyt długi.' setting_diff_max_lines_displayed: Maksymalna liczba linii różnicy do pokazania +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/pt-br.yml b/lang/pt-br.yml index c0320b9..90e7e77 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -697,3 +697,5 @@ label_user_activity: "Atividade de %s" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/pt.yml b/lang/pt.yml index 5b4ea1c..17cc36b 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -698,3 +698,5 @@ label_user_activity: "Actividade de %s" label_updated_time_by: Actualizado por %s há %s text_diff_truncated: '... Este diff foi truncado porque excede o tamanho máximo que pode ser mostrado.' setting_diff_max_lines_displayed: Número máximo de linhas de diff mostradas +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ro.yml b/lang/ro.yml index 72d8f87..25684ce 100644 --- a/lang/ro.yml +++ b/lang/ro.yml @@ -696,3 +696,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/ru.yml b/lang/ru.yml index ce051bd..2a8bd3c 100644 --- a/lang/ru.yml +++ b/lang/ru.yml @@ -730,3 +730,5 @@ text_user_wrote: '%s написал(а):' text_wiki_destroy_confirmation: Вы уверены, что хотите удалить данную Wiki и все ее содержимое? text_workflow_edit: Выберите роль и трекер для редактирования последовательности состояний +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/sk.yml b/lang/sk.yml index 8f87435..f1a96fc 100644 --- a/lang/sk.yml +++ b/lang/sk.yml @@ -702,3 +702,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/sr.yml b/lang/sr.yml index 4a4b6d0..dbe5c5e 100644 --- a/lang/sr.yml +++ b/lang/sr.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/sv.yml b/lang/sv.yml index df5fccf..8cd5cbe 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -696,4 +696,6 @@ default_activity_development: Utveckling enumeration_issue_priorities: Ärendeprioriteter enumeration_doc_categories: Dokumentkategorier -enumeration_activities: Aktiviteter (tidsuppföljning) \ No newline at end of file +enumeration_activities: Aktiviteter (tidsuppföljning) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/th.yml b/lang/th.yml index a569a50..cd3c481 100644 --- a/lang/th.yml +++ b/lang/th.yml @@ -699,3 +699,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/tr.yml b/lang/tr.yml index a587b42..d6f32ce 100644 --- a/lang/tr.yml +++ b/lang/tr.yml @@ -697,3 +697,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/uk.yml b/lang/uk.yml index b5d7c97..845fdec 100644 --- a/lang/uk.yml +++ b/lang/uk.yml @@ -698,3 +698,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/vn.yml b/lang/vn.yml index de5a4f0..5917677 100644 --- a/lang/vn.yml +++ b/lang/vn.yml @@ -699,3 +699,5 @@ label_user_activity: "%s's activity" label_updated_time_by: Updated by %s %s ago text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' setting_diff_max_lines_displayed: Max number of diff lines displayed +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml index ad6be1b..5679069 100644 --- a/lang/zh-tw.yml +++ b/lang/zh-tw.yml @@ -698,3 +698,5 @@ default_activity_development: 開發 enumeration_issue_priorities: 項目優先權 enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lang/zh.yml b/lang/zh.yml index 6e6b42b..e1e30d2 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -698,3 +698,5 @@ default_activity_development: 开发 enumeration_issue_priorities: 问题优先级 enumeration_doc_categories: 文档类别 enumeration_activities: 活动(时间跟踪) +text_plugin_assets_writable: Plugin assets directory writable +warning_attachments_not_saved: "%d file(s) could not be saved." diff --git a/lib/redmine/imap.rb b/lib/redmine/imap.rb index a6cd958..383d82f 100644 --- a/lib/redmine/imap.rb +++ b/lib/redmine/imap.rb @@ -1,4 +1,4 @@ -# redMine - project management software +# Redmine - project management software # Copyright (C) 2006-2008 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or @@ -33,9 +33,18 @@ module Redmine msg = imap.fetch(message_id,'RFC822')[0].attr['RFC822'] logger.debug "Receiving message #{message_id}" if logger && logger.debug? if MailHandler.receive(msg, options) + logger.debug "Message #{message_id} successfully received" if logger && logger.debug? + if imap_options[:move_on_success] + imap.copy(message_id, imap_options[:move_on_success]) + end imap.store(message_id, "+FLAGS", [:Seen, :Deleted]) else + logger.debug "Message #{message_id} can not be processed" if logger && logger.debug? imap.store(message_id, "+FLAGS", [:Seen]) + if imap_options[:move_on_failure] + imap.copy(message_id, imap_options[:move_on_failure]) + imap.store(message_id, "+FLAGS", [:Deleted]) + end end end imap.expunge diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake index 30101ca..0f74d6b 100644 --- a/lib/tasks/email.rake +++ b/lib/tasks/email.rake @@ -1,4 +1,4 @@ -# redMine - project management software +# Redmine - project management software # Copyright (C) 2006-2008 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or @@ -71,6 +71,11 @@ Issue attributes control options: allow_override=ATTRS allow email content to override attributes specified by previous options ATTRS is a comma separated list of attributes + +Processed emails control options: + move_on_success=MAILBOX move emails that were successfully received + to MAILBOX instead of deleting them + move_on_failure=MAILBOX move emails that were ignored to MAILBOX Examples: # No project specified. Emails MUST contain the 'Project' keyword: @@ -95,7 +100,9 @@ END_DESC :ssl => ENV['ssl'], :username => ENV['username'], :password => ENV['password'], - :folder => ENV['folder']} + :folder => ENV['folder'], + :move_on_success => ENV['move_on_success'], + :move_on_failure => ENV['move_on_failure']} options = { :issue => {} } %w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] } diff --git a/public/images/warning.png b/public/images/warning.png index bbef670b6a1db9f4fe60d34fd2b664daae4452a8..628cf2dae3d419ae220c8928ac71393b480745a3 100644 GIT binary patch delta 653 zc$@)^0&@MA1eyhq8Gi-<001BJ|6u?C00d`2O+f$vugEtAis=9V02y>eSaefwW^{L9 za%BKPWN%_+AW3auXJt}lVPtu6$z?nM00JyYL_t(I%cWCGNR$B({{DxnuIp>dR02a= zQjko_$TbabJq+s9W2tM=DWqeEE*&HYLW}H>M1@d?iV!RjEPsiJP6b&gMn-0?yRw*y z{*RfjgBpQr1rE&2VP-zQZ