Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of any stored email address #234

Open
mariusvandam opened this issue Aug 29, 2024 · 1 comment
Open

Validation of any stored email address #234

mariusvandam opened this issue Aug 29, 2024 · 1 comment
Labels
enhancement New feature or request triage

Comments

@mariusvandam
Copy link

mariusvandam commented Aug 29, 2024

Thema / Theme

Klantinteracties API

Omschrijving / Description

It is desirable to have OpenKlant validate any email addresses before storing them so that they are stored in a consistent way.

Toegevoegde waarde / Added value

This make sure only valid mail addresses are stored and any connected system can rely on the provided addresses.

Aanvullende opmerkingen / Additional context

As discussed on 29-8 with Andy, ICATT & Maykin

@mariusvandam mariusvandam added enhancement New feature or request triage labels Aug 29, 2024
@andyverberne
Copy link

andyverberne commented Sep 2, 2024

Hieronder de conversie en validatie regels en patterns welke in e-Suite worden gehanteerd

    /**
     * Gebaseerd op RFC 5322 (zie ook http://en.wikipedia.org/wiki/Email_address)
     * <p>
     * We ondersteunen niet alles (een quoted local part bijvoorbeeld niet). 
     * Er wordt ook niet gecontroleerd op de top level domain-naam bestaat en of de domain-naam een MX-record heeft.
     */
    private static final String ID = "A-Za-z\\d";

    private static final String LCL = "[" + ID + "!#$%&\'*+\\-/=?^_`{|}~]+";

    private static final String LBL = "[" + ID + "]([" + ID + "\\-]*[" + ID + "])?";

    private static final String ADDRESS = LCL + "(\\." + LCL + ")*@" + LBL + "(\\." + LBL + ")+";

    public static final String EMAIL = "^" + ADDRESS + "$";

    public static final Pattern EMAIL_PATTERN = Pattern.compile(EMAIL);

@mariusvandam mariusvandam changed the title Validation of any stored e-mailaddress Validation of any stored e-mail address Sep 12, 2024
@mariusvandam mariusvandam changed the title Validation of any stored e-mail address Validation of any stored email address Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
Status: Triage
Development

No branches or pull requests

2 participants