email_from_parens_format.diff

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

Download (671 Bytes)

View differences:

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