It happens once in a while, a path gets into a mail, but with this patch it should happen nevermore.
Looks for paths in non-production and raises if it finds one.
unless Rails.env.production? class ActionMailer::Base def render_message_with_path_protection(method_name, body) body = render_message_without_path_protection(method_name, body) if body =~ %r{((href|src)=['"]/.*)} raise "Use absolute path in mail urls! #{$1}" end body end alias_method_chain :render_message, :path_protection end end