SwiftEmailValidator - A Swift implementation of an international email address syntax validator based on RFC5321 & RFC5322

Overview

swift workflow codecov License: MIT Issues Releases

SwiftEmailValidator

A Swift implementation of an international email address syntax validator based on RFC5321 & RFC5322. Since email addresses are local @ remote the validator also includes IPAddressSyntaxValidator and EmailHostSyntaxValidator classes. This Swift Package does not require an Internet connection at runtime and is entirely self contained.

RFC5321 - Simple Mail Transfer Protocol https://datatracker.ietf.org/doc/html/rfc5321

RFC5322 - Internet Message Format https://datatracker.ietf.org/doc/html/rfc5322

Domains are validated against the Public Suffix List at https://publicsuffix.org . To update the built-in suffix list (PublicSuffixRulesRegistry.swift) use the Utilities/update-suffix.swift script.

Public Suffix List last updated on 2022-01-22 10:48:00 EST

EmailSyntaxValidator

if EmailSyntaxValidator.match("[email protected]") {
    print("[email protected] respects Email syntax rules")
}

IPAddressSyntaxValidator

if IPAddressSyntaxValidator.matchIPv6("::1") {
    print("::1 is a valid IPv6 address")
}

if IPAddressSyntaxValidator.matchIPv4("127.0.0.1") {
    print("127.0.0.1 is a valid IPv4 address")
}

if IPAddressSyntaxValidator.match("8.8.8.8") {
    print("8.8.8.8 is a valid IP address")
}

if IPAddressSyntaxValidator.match("fe80::1") {
    print("fe80::1 is a valid IP address")
}

EmailHostSyntaxValidator

Validates if the email's host name is following expected syntax rules and whether it is part of a known public suffix. Does NOT validate if the domain actually exists or even allowed by the registrar.

if EmailHostSyntaxValidator.match("yahoo.com") {
    print("yahoo.com has valid email host syntax")
}
You might also like...
Email-based instant messaging for iOS.
Email-based instant messaging for iOS.

deltachat-ios Email-based instant messaging for iOS. Testing Betas are distributed via Testflight. Just scan this QR code with the camera app of your

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

PhoneNumberKit Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Features F

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

PhoneNumberKit Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Features F

iOS App using NewsAPI API for International and French retrieval informations

Newsletter iOS App using NewsAPI API for International and French retrieval informations Les Tests Unitaires Logique & UI n'ont pas encore été intégré

iOS dictionary for international movie titles & Wikipedia mining tools
iOS dictionary for international movie titles & Wikipedia mining tools

MovieDict. What do they call it? International movie title database for iPhone An app for travelers and language learners who like to talk about their

ARSpaceStation - A minimal AR iOS App that shows the International Space Station (ISS) in real scale
ARSpaceStation - A minimal AR iOS App that shows the International Space Station (ISS) in real scale

AR Space Station This is a minimal AR iOS app that shows the International Space

An iOS AR app that allows you to walk in the International Space Station
An iOS AR app that allows you to walk in the International Space Station

AR Inside International Space Station (ISS) An iOS AR app that allows you to walk in the International Space Station. Xcode 13.2.1 Target: iOS / iPadO

ARInRoomISS - A minimal iOS AR app that displays the International Space Station (ISS) in the room
ARInRoomISS - A minimal iOS AR app that displays the International Space Station (ISS) in the room

A minimal iOS AR app to display the International Space Station (ISS) in the room.

FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.
FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.

FlexLayout adds a nice Swift interface to the highly optimized Yoga flexbox implementation. Concise, intuitive & chainable syntax. Flexbox is an incre

📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.

DuctTape 📦 KeyPath dynamicMemberLookup based syntax sugar for Swift. let label: UILabel = UILabel().ductTape .numberOfLines(0) .textColor(.re

Postal is a swift framework providing simple access to common email providers.
Postal is a swift framework providing simple access to common email providers.

Postal is a swift framework providing simple access to common email providers. Example Connect let postal = Postal(configuration: .icloud(login: "myem

Email Validation Example With Swift

EmailValidation Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation Em

Send email to any SMTP server like a boss, in Swift and cross-platform
Send email to any SMTP server like a boss, in Swift and cross-platform

Hedwig is a Swift package which supplies a set of high level APIs to allow you sending email to an SMTP server easily. If you are planning to send ema

ProtonMail for macOS - Experimental email client for the ProtonMail service written in Swift
ProtonMail for macOS - Experimental email client for the ProtonMail service written in Swift

ProtonMail for macOS Experimental email client for the ProtonMail service written in Swift. About A pet project, largely incomplete and missing major

Advanced Natural Motion Animations, Simple Blocks Based Syntax
Advanced Natural Motion Animations, Simple Blocks Based Syntax

FlightAnimator Moved to Swift 3.1 Support: For Swift 3.1 - Use tag Version 0.9.9 See Installation Instructions for clarification Introduction FlightAn

A lightweight but powerful network library with simplified and expressive syntax based on AFNetworking.
A lightweight but powerful network library with simplified and expressive syntax based on AFNetworking.

XMNetworking English Document XMNetworking 是一个轻量的、简单易用但功能强大的网络库,基于 AFNetworking 3.0+ 封装。 其中,XM 前缀是我们团队 Xcode-Men 的缩写。 简介 如上图所示,XMNetworking 采用中心化的设计思想

LoginKit is a quick and easy way to add Facebook and email Login/Signup UI to your app.
LoginKit is a quick and easy way to add Facebook and email Login/Signup UI to your app.

LoginKit About LoginKit is a quick and easy way to add Facebook and email Login/Signup UI to your app. If you need to quickly prototype an app, create

Tutanota is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.
Tutanota is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.

Tutanota makes encryption easy Tutanota is the secure email service with built-in end-to-end encryption that enables you to communicate securely with

UI-элемент Поле для ввода кода подтверждения из смс или email
UI-элемент Поле для ввода кода подтверждения из смс или email

SWCodeField SWCodeField - простое поле для ввода кода подтверждения из смс или email с возможность изменения количества элементов. UI-элемент основан

Comments
  • SwiftPublicSuffixList dependancy issue

    SwiftPublicSuffixList dependancy issue

    After installing the SwiftEmailValidator package via the Xcode's package dependency tool, I get the following error: The package product 'SwiftPublicSuffixList' requires minimum platform version 11.0 for the iOS platform, but this target supports 9.0

    My iOS Deployment Target is 15.0, the SwiftPublicSuffixList Package.swift file shows the iOS requirement of v11.

    Am I missing something here?

    Thanks, Ron Dyck

    opened by rondyck 5
Releases(1.0.3)
  • 1.0.0(Feb 2, 2022)

    SwiftEmailValidator is finally feature complete with RFC2047 auto-encoding option, full Unicode support and Public Suffix validation. As recommended by users on Reddit, options have been added to be able to bypass the Public Suffix lookup and use a custom Regex for the domain.

    Source code(tar.gz)
    Source code(zip)
  • 0.9.2(Jan 30, 2022)

  • 0.9.1(Jan 28, 2022)

    Version 0.9.1 of the library brings full international email validation support for SMTP server validation. Missing to reach the 1.0 milestone are .userInterface validation strategy support to allow some automatic reformatting of the email before using the strict validator.

    Source code(tar.gz)
    Source code(zip)
  • 0.9(Jan 28, 2022)

    Version 0.9 of the library brings full international email validation support for SMTP server validation. Missing to reach the 1.0 milestone are .userInterface validation strategy support to allow some automatic reformatting of the email before using the strict validator.

    Source code(tar.gz)
    Source code(zip)
  • 0.6(Jan 27, 2022)

  • 0.5(Jan 23, 2022)

    Pre-alpha release with US-ASCII email validation. RFC2047 class added for decoding Unicode email addresses but not yet fully supported in the validator

    Source code(tar.gz)
    Source code(zip)
Owner
Dave Poirier
Dave Poirier
Declarative form validator for SwiftUI.

SwiftUIFormValidator The world's easiest, most clean SwiftUI form validation. SwiftUIFormValidator A declarative SwiftUI form validation. Clean, simpl

Shaban Kamel 42 Dec 13, 2022
Input Validation Done Right. A Swift DSL for Validating User Input using Allow/Deny Rules

Valid Input Validation Done Right. Have you ever struggled with a website with strange password requirements. Especially those crazy weird ones where

Mathias Quintero 37 Nov 3, 2022
Swift Validator is a rule-based validation library for Swift.

Swift Validator is a rule-based validation library for Swift. Core Concepts UITextField + [Rule] + (and optional error UILabel) go into

null 1.4k Dec 29, 2022
Google Places address entry for iOS (Swift)

GooglePlacesAutocomplete A simple Google Places API autocompleting address entry view for iOS devices. There are already a couple of solutions out the

Howard Wilson 271 Sep 26, 2022
Manage multi-domain url auto mapping ip address table.

Domainer Multi-domain mapper. This library provides manage multi-domain table. Features Manage multi-domain mapping main domain. Find best domain whic

Felix 6 Apr 4, 2020
Get your device ip address, router ip or wifi ssid

FGRoute FGRoute is written on C and Objective C (includes Swift support), it helps developers to get rid of dealing with WiFi interfaces. Example To r

Arthur Sahakyan 137 Dec 5, 2022
Swift String Validator. Simple lib for ios to validate string and UITextFields text for some criterias

Swift String validator About Library for easy and fastest string validation based on сciterias. Instalation KKStringValidator is available through Coc

Kostya 17 Dec 21, 2019
A Payment Card UI & Validator for iOS

Description Caishen provides an easy-to-use text field to ask users for payment card information and to validate the input. It serves a similar purpos

Prolific Interactive 766 Dec 28, 2022
Declarative form validator for SwiftUI.

SwiftUIFormValidator The world's easiest, most clean SwiftUI form validation. SwiftUIFormValidator A declarative SwiftUI form validation. Clean, simpl

Shaban Kamel 42 Dec 13, 2022
A validator for postal codes with support for 200+ regions

PostalCodeValidator A validator for postal codes with support for 200+ regions. import Foundation import PostalCodeValidator if let validator = Posta

FormatterKit 211 Jun 17, 2022