Skip to content

fix(other): email validation require fqdn tld#1817

Merged
kroky merged 7 commits intocypht-org:masterfrom
IrAlfred:fix-email-validation-require-fqdn-tld
Feb 26, 2026
Merged

fix(other): email validation require fqdn tld#1817
kroky merged 7 commits intocypht-org:masterfrom
IrAlfred:fix-email-validation-require-fqdn-tld

Conversation

@IrAlfred
Copy link
Copy Markdown
Member

@IrAlfred IrAlfred commented Dec 28, 2025

Fix email validation and add RFC 5322 compliance

Issue

  • Email addresses without proper TLD were accepted (e.g., alfred@test, patrick@example)
  • Valid RFC 5322 formats were rejected (IPv6 addresses, quoted strings, internationalized domains)

Changes: Added RFC 5322 compliant validation

  • Client-side: modules/core/site.js, modules/smtp/site.js
  • Server-side: modules/core/functions.php
  • Support for domain literals (IPv4/IPv6), quoted local-parts, IDN, group syntax
  • Enforces minimum 2 domain labels (fixes TLD issue)

@IrAlfred IrAlfred changed the title Fix email validation require fqdn tld fix(other): email validation require fqdn tld Dec 28, 2025
@IrAlfred IrAlfred requested a review from kroky December 28, 2025 21:29
@IrAlfred IrAlfred force-pushed the fix-email-validation-require-fqdn-tld branch from ee354c3 to 611a3c5 Compare January 13, 2026 17:59
@IrAlfred IrAlfred requested a review from kroky January 13, 2026 18:05
@IrAlfred IrAlfred force-pushed the fix-email-validation-require-fqdn-tld branch 2 times, most recently from 2ea4f52 to 39a2652 Compare January 14, 2026 15:56
@IrAlfred IrAlfred requested a review from kroky January 15, 2026 04:27
@IrAlfred IrAlfred force-pushed the fix-email-validation-require-fqdn-tld branch 2 times, most recently from fbdbd62 to 97e9f16 Compare February 7, 2026 06:18
@IrAlfred
Copy link
Copy Markdown
Member Author

IrAlfred commented Feb 7, 2026

In fact, the is_valid_recipient function, used on the Compose page for example, uses different validation logic compared to a simple email field on the contact form, which only accepts the email address. It must accept these different formats:

  • Display Name <email@example.com>,
  • Display Name email@example.com, or
  • email@example.com

@IrAlfred IrAlfred requested a review from kroky February 7, 2026 06:28
@IrAlfred IrAlfred force-pushed the fix-email-validation-require-fqdn-tld branch from 97e9f16 to 7024591 Compare February 22, 2026 13:36
@IrAlfred IrAlfred requested a review from kroky February 22, 2026 21:51
@IrAlfred IrAlfred force-pushed the fix-email-validation-require-fqdn-tld branch from e217611 to aae8f90 Compare February 23, 2026 07:21
@kroky kroky merged commit 971a432 into cypht-org:master Feb 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants