Skip to content

MID-11048 Add option to relax email address validation on send#578

Open
wadahiro wants to merge 1 commit intoEvolveum:support-4.10from
openstandia:issue-11048
Open

MID-11048 Add option to relax email address validation on send#578
wadahiro wants to merge 1 commit intoEvolveum:support-4.10from
openstandia:issue-11048

Conversation

@wadahiro
Copy link
Copy Markdown
Contributor

By setting -Dmail.mime.address.strict=false as a JVM system property, email addresses that do not strictly comply with RFC822 (e.g. consecutive dots in local part like user...name@example.com) are now accepted.

We use the standard Jakarta Mail property mail.mime.address.strict instead of a MidPoint-specific property (e.g. midpoint.mail.address.strict) because MimeMessage.getAllRecipients() internally calls getAddressHeader() which references this property. If a custom property were used, address parsing in parseInternetAddress() would be non-strict, but getAllRecipients() at send time would still parse strictly and fail.

By setting -Dmail.mime.address.strict=false as a JVM system property,
email addresses that do not strictly comply with RFC822
(e.g. consecutive dots in local part like user...name@example.com)
are now accepted.

We use the standard Jakarta Mail property "mail.mime.address.strict"
instead of a MidPoint-specific property (e.g. midpoint.mail.address.strict)
because MimeMessage.getAllRecipients() internally calls getAddressHeader()
which references this property. If a custom property were used, address
parsing in parseInternetAddress() would be non-strict, but
getAllRecipients() at send time would still parse strictly and fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant