+ def canonical_email(email)
+ local_part, domain = if email.nil?
+ nil
+ else
+ email.split("@")
+ end
+
+ local_part.sub!(/\+.*$/, "")
+
+ local_part.delete!(".") if %w[gmail.com googlemail.com].include?(domain)
+
+ "#{local_part}@#{domain}"
+ end
+