![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
saksh-email-validator
Advanced tools
A comprehensive email validation module with syntax, domain, blacklist, and SMTP checks.
This Email Validation Module provides a comprehensive solution for validating email addresses. It includes various features such as syntax validation, domain checks, blacklist checks, disposable email detection, role-based email detection, and SMTP server validation. Additionally, it supports custom validation rules and offers suggestions for correcting common email syntax errors.
Here’s an example of how to use the email validation module:
const {
sakshValidateEmail,
sakshValidateEmailBatch,
sakshCache,
sakshAddCustomValidationRule
} = require('saksh-email-validator');
// Custom validation rule 1: Disallow emails containing "test"
function customRule1(email) {
return {
valid: !email.includes('test'),
reason: 'Emails containing "test" are not allowed.',
priority: 1 // Higher priority
};
}
// Custom validation rule 2: Disallow emails from "example.com"
function customRule2(email) {
const domain = email.split('@')[1];
return {
valid: domain !== 'example.com',
reason: 'Emails from "example.com" are not allowed.',
priority: 2 // Lower priority
};
}
// Example email addresses to test
const emails = [
'valid.email@allowed.com',
'test.email@allowed.com',
'valid.email@example.com',
'test.email@example.com',
'susheelhbti@gmail.com',
'saksh@sakshamapp.com',
'susheel@aistore2030.com'
];
// Configuration object
const config = {
validateMx: true,
validateSmtp: true,
blacklistedDomains: [],
disposableDomains: [],
roleBasedEmails: [],
wellKnownDomains: ['sakshamapp.com'],
customValidationRules: [customRule1, customRule2]
};
// Test the email validation function
async function testEmailValidation() {
for (const email of emails) {
const result = await sakshValidateEmail(email, config);
console.log(`Validation result for ${email}:`, result);
}
}
testEmailValidation();
function clearCache() {
sakshCache.flushAll();
console.log('Cache cleared.');
}
// clearCache()
sakshValidateEmailSyntax(email)
email
(string) - The email address to validate.boolean
- Returns true
if the email syntax is valid, false
otherwise.sakshEmailSyntaxSuggestions(email)
email
(string) - The email address to suggest corrections for.string[]
- Returns an array of suggested email formats.sakshCheckDomainMXRecords(email)
email
(string) - The email address to check.Promise
- Resolves to true
if the domain has MX records, false
otherwise.sakshIsDomainBlacklisted(email, customBlacklistedDomains = [])
email
(string) - The email address to check.customBlacklistedDomains
(string[]) - Custom blacklisted domains.boolean
- Returns true
if the domain is blacklisted,This email validation module offers a robust set of features to ensure the validity of email addresses. It is highly configurable and can be extended with custom validation rules to meet specific requirements. The module also provides helpful suggestions for correcting common email errors, making it a comprehensive solution for email validation needs.
susheel2339 at gmail.com
FAQs
A comprehensive email validation module with syntax, domain, blacklist, and SMTP checks.
We found that saksh-email-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.