Project

General

Profile

Feature #17699 » email_from_parens_format.diff

Stanislav German-Evtushenko, 2014-08-16 23:51

View differences:

app/models/mail_handler.rb (working copy)
addr, name = from, nil
if m = from.match(/^"?(.+?)"?\s+<(.+@.+)>$/)
addr, name = m[2], m[1]
elsif m = from.match(/^(.+@.+)\s+\((.+?)\)$/)
addr, name = m[1], m[2]
end
if addr.present?
logger.info "MailHandler: creating user from email for [#{addr}]" if logger
user = self.class.new_user_from_attributes(addr, name)
if @@handler_options[:no_notification]
user.mail_notification = 'none'
(1-1/6)