ドットが連続したメールアドレスに対処するパッチ(Mail::Message.from)
# coding: utf-8
module Mail
class Message
def from_with_patch_rfc_violation
str = from_without_patch_rfc_violation
begin
str = str.join
rescue
str = str.to_s
end
str.scan(/^.*?([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+?)(?![a-zA-Z0-9._-]).*$/).flatten.first
end
alias_method_chain :from, :patch_rfc_violation
end
end