mikel/mail — pull request #825 by bpot (2014-11-01 20:49:55+00:00)
Title: Improve performance of Message#find_attachment

This faster because we,

- Don't trigger exceptions for flow control.
- Retrieve each header only once (at most).

The exceptions this was throwing were particularly expensive for us on jruby. This change cut our mail processing time in half for a particular task.

The tests are passing with this change but it's possible that the `rescue`s in the previous code were catching other exceptions that will now bubble up. We could add a `rescue` to `find_attachment_filename` to catch those.