MantisBT: master 2eebb746

Author Committer Branch Timestamp Parent
dregad dregad master 2014-05-01 13:46 master 4bb1dcac
Changeset

Allow choice of email validation method

Following implementation of 50d235ad101f61a6c6888316e827fd225ad4b9cd the
validation of email addresses was done by PHPMailer::validateAddress()
instead of filter_var() with FILTER_SANITIZE_EMAIL to allow RFC5322-
compliant emails like 'user@domain' that are rejected by PHP's method
which only accepts 'user@domain.tld'.

However, these 'top-level-domain-only' addresses are often considered as
invalid by SMTP servers but there is a strong use-case for them in
intranet environments.

To enable both scenarios, this commit introduces new constants for
$g_validate_email, allowing the admin to pick whether they want
validation using the PHP method (default) or strict RFC5322.

Backwards compatibility is maintained because EMAIL_VALIDATE_PHP == ON,
and validation can still be disabled with OFF.

mod - config_defaults_inc.php Diff File
mod - core/constant_inc.php Diff File
mod - core/email_api.php Diff File
mod - docbook/Admin_Guide/en-US/config/email.xml Diff File