Skip to content

Pipe character (|) in domain is not blocked by PROHIBITED_DOMAIN_CHARACTERS_REGEX #314

Description

@KJambo

| is not in PROHIBITED_DOMAIN_CHARACTERS_REGEX, so emails with a pipe in the domain incorrectly pass validation:

ValidEmail2::Address.new("user@example.com|").valid?  # => true (should be false)

Per RFC 5321, domain labels only allow [a-zA-Z0-9-]. Adding | to the regex would fix this:

PROHIBITED_DOMAIN_CHARACTERS_REGEX = /[+!_\/\s'`|]/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions