rails/rails — pull request #13090 by themgt (2013-11-28 21:29:30+00:00)
Title: test for interacting with #mail post-message creation

so I'm not sure the best way to fix this, but calling ActionMailer::Base#mail a second time seems to result in mail data being reset. I ran into this trying to log mail data in an after_action, but it can also be done within the mailer method. I wrote a failing test case using a code example taken just about straight out of docs:
http://edgeguides.rubyonrails.org/action_mailer_basics.html#action-mailer-callbacks

my solution for now is just to use @_message, but basically it seems like #mail shouldn't overwrite already-set headers if the new header is blank (line 716 in action_mailer/base.rb)