https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292014-11-24T09:55:49ZRedmineRedmine - Defect #14699: Cannot change "From" header in email notificationshttps://www.redmine.org/issues/14699?journal_id=599882014-11-24T09:55:49ZVincent Robert
<ul><li><strong>File</strong> <a href="/attachments/12736">merge_headers.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/12736/merge_headers.diff">merge_headers.diff</a> added</li></ul><p>Here is a patch where we use the <code>headers.reverse_merge!</code> method instead of <code>headers.merge!</code></p>
<p>As we can pass headers as a parameter, I think we should use a reverse_merge in order to not override our hash with default values:</p>
<pre>
def mail(headers={}, &block)
headers.reverse_merge! 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name,
'X-Redmine-Site' => Setting.app_title,
'X-Auto-Response-Suppress' => 'OOF',
'Auto-Submitted' => 'auto-generated',
'From' => Setting.mail_from,
'List-Id' => "<#{Setting.mail_from.to_s.gsub('@', '.')}>"
</pre>
<p>This could be very useful in some of my plugins. Thanks</p> Redmine - Defect #14699: Cannot change "From" header in email notificationshttps://www.redmine.org/issues/14699?journal_id=604362014-12-17T15:02:50ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Target version</strong> set to <i>2.6.1</i></li></ul> Redmine - Defect #14699: Cannot change "From" header in email notificationshttps://www.redmine.org/issues/14699?journal_id=604972014-12-21T19:47:10ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> changed from <i>Email notifications</i> to <i>Code cleanup/refactoring</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fix committed in <a class="changeset" title="Don't overwrite headers that were already set (#14699)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/13784">r13784</a>, thanks.</p> Redmine - Defect #14699: Cannot change "From" header in email notificationshttps://www.redmine.org/issues/14699?journal_id=605872014-12-26T10:41:21ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>