# HG changeset patch
# User dedalus
# Date 1366958134 -7200
# Node ID 388c30688ed8ba13ad24bb2dbda58d7edf3eb382
# Parent 49ab2264e23cf55731d84655e3ae7abf679013f5
bug #13851: makes message-id invariant respect to daylight savings
diff -r 49ab2264e23c -r 388c30688ed8 app/models/mailer.rb
--- a/app/models/mailer.rb Tue Apr 23 04:10:30 2013 +0000
+++ b/app/models/mailer.rb Fri Apr 26 08:35:34 2013 +0200
@@ -452,7 +452,9 @@
def self.message_id_for(object)
# id + timestamp should reduce the odds of a collision
# as far as we don't send multiple emails for the same object
- timestamp = object.send(object.respond_to?(:created_on) ? :created_on : :updated_on)
+
+ timestamp = timestamp.localtime
+
hash = "redmine.#{object.class.name.demodulize.underscore}-#{object.id}.#{timestamp.strftime("%Y%m%d%H%M%S")}"
host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')
host = "#{::Socket.gethostname}.redmine" if host.empty?