Itch Scratching the ActionMailer API

Mikel Lindsaar (RubyX)
Location: Ballroom I Level: Novice
Average rating: ****.
(4.67, 9 ratings)

ActionMailer has been the long neglected sibling of the Rails Framework, with it’s monkey patches and TMail hacks backed right in, it was in long need of a rewrite.

But rewriting ActionMailer required a new Mail handler, something that could just “DO” the mail part.

I started patching TMail in 2006, I found holes and fixed them, shortly after I was made the maintainer of TMail. I released several versions and upgraded ActionMailer to suit, but ActionMailer never became a product I would like to use myself.

Needing a solution, I wrote Mail. Using RSpec, this library is totally BDD’d from the ground up, and I will cover that in the talk, how it was developed and how developing a gem, in real life, against existing RFCs, with full spec coverage, can impact the end result.

Once I finished Mail I went to work replacing TMail out from ActionMailer. This went well, and then in December, 2010, I was asked by DHH to implement a new API to ActionMailer,

I took on the job and José Valim and I remote pair programmed, (between Poland and Sydney). In two weeks working only in the evenings, we stripped ActionMailer, deprecating (but keeping) the old interface and installing a brand new sleek ActionMailer API, one that now just acts as a bridge between AbstractController and Mail.

I go over in the talk how this deprecation was done, and how it can be done anywhere if you think the thought through. I will also go over how in doing this ActionMailer rewrite, I found parts of Mail that needed upgrading and how the existing spec suite made it possible.

Finally, I will briefly discuss the difficulties I ran into in getting Mail and ActionMailer running on Ruby 1.8.7 and 1.9.1 and 1.9-current.

I will be open for questions as well on the new API and future direction of it.

Photo of Mikel Lindsaar

Mikel Lindsaar


From Sydney Australia, Mikel works as an IT Consultant, Developer and founder of an Rails development and support company in Sydney Australia.

Mikel’s talk this year will be drawing from the 40+ production Rails apps he and his company developed and maintained in the last 12 months.

Mikel is on the core commit team of the Rails framework, wrote the Mail gem and was a major part of the rewrite of ActionMailer.

He also recently ran in the RailsRumble, successfully releasing with his team and last year also wrote and released TellThemWhen

He spends his days running the RubyX team providing green field application development, custom gem development as well as support, code review and mentoring on existing Rails applications. He gets his hands dirty in Rails code all the time and loves his work.

co-presented by Ruby Central, Inc. O'Reilly
  • Engine Yard
  • Heroku
  • 8th Light
  • Blue Box Group
  • InfoEther
  • JetBrains
  • New Relic
  • Open Hosting
  • Rhomobile
  • WyeWorks
  • Linux Pro Magazine
  • Chargify

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine at

Download the RailsConf Sponsor/Exhibitor Prospectus

Media Partner Opportunities

For information on trade opportunities with O'Reilly conferences or contact mediapartners@

Program Ideas

Send us your suggestions for speakers, topics, and activities to

Press and Media

For media-related inquiries, contact Maureen Jennings at

RailsConf Newsletter

To stay abreast of conference news please sign up for the RailsConf newsletter (login required)

Contact Us

View a complete list of RailsConf 2010 contacts.