Skip to content

normalize email addresses to their canonical form

Notifications You must be signed in to change notification settings

adaphan/normalize_email

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

normalize-email

Based on

This repo is a golang port of JS library: https://github.com/iDoRecall/email-normalize

Introduction

normalize-email normalizes email addresses to their canonical form.

  • remove dots in GMail or email addresses hosted by similar services (Google Apps for Work, FastMail)
  • remove address tags starting with '+', or '-' for Yahoo!, or '=' as well if desired
  • converts alias domains to the canonical one, e.g. googlemail.com to gmail

Works for

Sample Normalizations

Usage

sync version

    ... 
    rawEmail := "[email protected]
    normEmail := normalize_email.Normalize(rawEmail, nil, nil)

    // normEmail == "[email protected]"
    ...

async version for detect provider

    ... 
    callback = make(chan string)
    ... 
    rawEmail := "[email protected]
    _ := normalize_email.Normalize(rawEmail, &Option{DetectProvider: true}, callback)
    ... 
    normEmail := <- callback

    // normEmail == "[email protected]"
    ...

Please also refer normalize_test.go for examples.

_

About

normalize email addresses to their canonical form

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%