Project

General

Profile

Feature #23011

Updated by Toshi MARUYAMA almost 8 years ago

In `dispatch` of `app/models/mail_handler.rb` a global named `MESSAGE_ID_RE` is used, which is defined as the regular expression: 

 <pre><code class="ruby"> ~~~ 
 MESSAGE_ID_RE = %r{^<?redmine\.([a-z0-9_]+)\-(\d+)\.\d+(\.[a-f0-9]+)?@} 
 </code></pre> ~~~ 

 The conditional in `dispatch` does the following: 

 <pre><code class="ruby"> ~~~ 
 if headers.detect {|h| h.to_s =~ MESSAGE_ID_RE} 
       klass, object_id = $1, $2.to_i 
       method_name = "receive_#{klass}_reply" 
       if self.class.private_instance_methods.collect(&:to_s).include?(method_name) 
         send method_name, object_id 
       else 
         # ignoring it 
       end 
 end 
 </code></pre> ~~~ 

 The purpose of this global (and its conditional in `dispatch`) isn't quite clear to me, as it is also lacking comments. I suspect that it looks for redmine's own e-mail-address and then calls a supplied method? 

 Why should redmine talk to itself through e-mails in such a way? What if I change redmine's e-mail-address to something not containing redmine? What will break (if anything)? 

 We recently changed the naming of our redmine instance (both the domain-name and the e-mail-address now do not contain redmine) to something more obvious for non-tech folk. We would hate to have broken something by that change.

Back