diff -ur ../tmp/redmine-1.0.1/app/models/mailer.rb ./app/models/mailer.rb --- ../tmp/redmine-1.0.1/app/models/mailer.rb 2010-08-19 06:30:23.000000000 +0200 +++ ./app/models/mailer.rb 2010-09-04 19:56:32.000000000 +0200 @@ -40,6 +40,7 @@ 'Issue-Id' => issue.id, 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", issue.project.identifier) unless Setting.mail_from_pattern.to_s.empty? message_id issue recipients issue.recipients cc(issue.watcher_recipients - @recipients) @@ -60,6 +61,7 @@ 'Issue-Id' => issue.id, 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", issue.project.identifier) unless Setting.mail_from_pattern.to_s.empty? message_id journal references issue @author = journal.user @@ -94,6 +96,7 @@ # Mailer.deliver_document_added(document) => sends an email to the document's project recipients def document_added(document) redmine_headers 'Project' => document.project.identifier + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", document.project.identifier) unless Setting.mail_from_pattern.to_s.empty? recipients document.recipients subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}" body :document => document, @@ -125,6 +128,7 @@ recipients container.recipients end redmine_headers 'Project' => container.project.identifier + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", container.project.identifier) unless Setting.mail_from_pattern.to_s.empty? subject "[#{container.project.name}] #{l(:label_attachment_new)}" body :attachments => attachments, :added_to => added_to, @@ -139,6 +143,7 @@ # Mailer.deliver_news_added(news) => sends an email to the news' project recipients def news_added(news) redmine_headers 'Project' => news.project.identifier + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", news.project.identifier) unless Setting.mail_from_pattern.to_s.empty? message_id news recipients news.recipients subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}" @@ -155,6 +160,7 @@ def message_posted(message) redmine_headers 'Project' => message.project.identifier, 'Topic-Id' => (message.parent_id || message.id) + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", message.project.identifier) unless Setting.mail_from_pattern.to_s.empty? message_id message references message.parent unless message.parent.nil? recipients(message.recipients) @@ -173,6 +179,7 @@ def wiki_content_added(wiki_content) redmine_headers 'Project' => wiki_content.project.identifier, 'Wiki-Page-Id' => wiki_content.page.id + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", wiki_content.project.identifier) unless Setting.mail_from_pattern.to_s.empty? message_id wiki_content recipients wiki_content.recipients cc(wiki_content.page.wiki.watcher_recipients - recipients) @@ -190,6 +197,7 @@ def wiki_content_updated(wiki_content) redmine_headers 'Project' => wiki_content.project.identifier, 'Wiki-Page-Id' => wiki_content.page.id + from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", wiki_content.project.identifier) unless Setting.mail_from_pattern.to_s.empty? message_id wiki_content recipients wiki_content.recipients cc(wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients) diff -ur ../tmp/redmine-1.0.1/app/views/settings/_notifications.rhtml ./app/views/settings/_notifications.rhtml --- ../tmp/redmine-1.0.1/app/views/settings/_notifications.rhtml 2009-12-19 21:07:09.000000000 +0100 +++ ./app/views/settings/_notifications.rhtml 2010-09-04 19:43:33.000000000 +0200 @@ -4,6 +4,8 @@

<%= setting_text_field :mail_from, :size => 60 %>

+

<%= setting_text_field :mail_from_pattern, :size => 60 %>

+

<%= setting_check_box :bcc_recipients %>

<%= setting_check_box :plain_text_mail %>

diff -ur ../tmp/redmine-1.0.1/config/locales/en.yml ./config/locales/en.yml --- ../tmp/redmine-1.0.1/config/locales/en.yml 2010-08-22 21:48:52.000000000 +0200 +++ ./config/locales/en.yml 2010-09-04 19:45:46.000000000 +0200 @@ -303,6 +303,7 @@ setting_attachment_max_size: Attachment max. size setting_issues_export_limit: Issues export limit setting_mail_from: Emission email address + setting_mail_from_pattern: Emission email address pattern setting_bcc_recipients: Blind carbon copy recipients (bcc) setting_plain_text_mail: Plain text mail (no HTML) setting_host_name: Host name and path diff -ur ../tmp/redmine-1.0.1/config/settings.yml ./config/settings.yml --- ../tmp/redmine-1.0.1/config/settings.yml 2010-08-22 21:49:26.000000000 +0200 +++ ./config/settings.yml 2010-09-04 19:55:23.000000000 +0200 @@ -47,6 +47,11 @@ default: '25,50,100' mail_from: default: redmine@example.net +# pattern for From address +# - can replace '%%projectid%%' with project ID +# ex: %%projectid%%-support@example.net" +mail_from_pattern: + default: "" bcc_recipients: default: 1 plain_text_mail: