# ActionMailer Message-Id field

**URL:** <https://www.ruby-forum.com/t/actionmailer-message-id-field/116253>\
**Category:** Rails\
**Created:** [October 3, 2007, 9:56pm UTC](https://www.ruby-forum.com/t/actionmailer-message-id-field/116253 "2007-10-03T21:56:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [October 3, 2007, 9:56pm UTC](https://www.ruby-forum.com/t/actionmailer-message-id-field/116253/1 "2007-10-03T21:56:51Z")

</div>

I am attempting to set my own value for the message-id header in emails  
delivered via ActionMailer. The underlying TMail object allows the  
message\_id to be set, but it looks like the deliver method of action  
mailer will overwrite any value that is presently there at the time of  
delivery.

Looking at action mailer’s base.rb file, you can see that the  
perform\_delivery\_smtp method calls the ready\_to\_send method, which calls  
add\_message\_id, which definitively sets the message\_id property to the  
result of TMail::new\_message\_id.

Has anyone figured out a way to use their own message ids without  
modifying the action mailer code?
