{"id":16880007,"url":"https://github.com/aledbf/emailvalidator","last_synced_at":"2025-03-20T02:32:21.305Z","repository":{"id":20829449,"uuid":"24115407","full_name":"aledbf/EmailValidator","owner":"aledbf","description":"A web microservice to check for email address validity against MX/A records and the SMTP server","archived":false,"fork":false,"pushed_at":"2014-07-15T09:15:41.000Z","size":256,"stargazers_count":0,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T05:24:53.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"FMGSuite/EmailValidator","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aledbf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-16T19:55:34.000Z","updated_at":"2014-06-27T17:53:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cffccad-6ba5-462e-9bef-cdc2bda8b10d","html_url":"https://github.com/aledbf/EmailValidator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2FEmailValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2FEmailValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2FEmailValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aledbf%2FEmailValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aledbf","download_url":"https://codeload.github.com/aledbf/EmailValidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538574,"owners_count":20468740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T15:56:56.455Z","updated_at":"2025-03-20T02:32:21.279Z","avatar_url":"https://github.com/aledbf.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# EmailValidator\n\nEmailValidator is a simple node.js helper library to check an email address's validity without sending a single email.\n\n## Why?\n\nIf you send commercial email you know getting your email delivered is very hard - even if you follow all the rules. A high bounce rate (above 3%) can cause your delivery rates to drop dramatically. By validating email addresses that your team may collect over the phone and hand enter into a CRM you can protect yourself and decrease your bounce rate. Thereby increasing your email marketing effectiveness.\n\n## Features\n\n* Very basic email syntax check. \n* Check for valid MX records\n* If no MX records are found, check for valid A record\n* Verify MX/A has a listening email server\n* Redis used as a cache to improve speed and avoid bombarding mail servers\n\n## Risks\n\nIt is possible that if you query a single provider too much that the email provider will block you. We've implemented a Redis cache to mitigate this.\n\nIt is possible that you perform a validity check when an ISP's SMTP server is down, inaccurately noting it as offline.\n\nTo do: Right now we just query the first MX record instead of all of them. The code should be refactored to loop through each MX record asynchronously. Anyone care to help?\n\n## Installation\n\nsetup redis\n\n`./src/redis-server /usr/redis-2.8.9/redis.conf`\n\nWe'll just use the default port. If you have something custom, then you'll need to configure the connection.\n\nNext, install the package\n\n`npm install emailvalidator`\n\n\n## Using as a node module\n\nIn the simplest form you can just call:\n\n```javascript\nvar options = {\n    externalIpAddress: '93.184.216.119', \n    redisPort: 6379, \n    redisHost: '127.0.0.1'\n}\nrequire('emailvalidator').checkEmailAddress('me@lucasjans.com', options, callback);\n```\n\nThe parameters are optional, but should you lave a blank externalIpAddress you may affect the accuracy of the program.\n\nTo lookup your external IP address, just call\n\n```javascript\nrequire('emailvalidator').getExternalIp(callback)\n```\n\nthe callback is `function(error, response)`\n\nthe response object is:\n\n```javascript\n{\n    \"email\": \"me@lucasjans.com\",\n    \"valid\": false,\n    \"reason\": \"no server to receive mail. cannot connect to mail exchanger\"\n}\n```\n\n## Using as a Microservice\n\nBuilt into this module is a webserver that responds to GET requests on /:email\n\nTo start this webserver automatically, just run `npm start`\n\nOtherwise, you can run it programatically by calling \n\n```javascript\nvar options = {\n    // defaults to 3000\n    port: integer,\n    // if null/empty we will look this up automatically\n    externalIpAddress: '',\n    // defaults to 127.0.0.1\n    redisHost: integer,\n    // defaults to 6379\n    redisPort: integer\n}\n\nrequire('emailvalidator').startWebServer(options)\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faledbf%2Femailvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faledbf%2Femailvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faledbf%2Femailvalidator/lists"}