mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
Merge branch 'w04_MDL-31202_m23_emailvalidation' of git://github.com/skodak/moodle
This commit is contained in:
commit
e24baafefc
@ -5028,6 +5028,17 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!validate_email($user->email)) {
|
||||||
|
// we can not send emails to invalid addresses - it might create security issue or confuse the mailer
|
||||||
|
$invalidemail = "User $user->id (".fullname($user).") email ($user->email) is invalid! Not sending.";
|
||||||
|
error_log($invalidemail);
|
||||||
|
if (CLI_SCRIPT) {
|
||||||
|
// do not print this in standard web pages
|
||||||
|
mtrace($invalidemail);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (over_bounce_threshold($user)) {
|
if (over_bounce_threshold($user)) {
|
||||||
$bouncemsg = "User $user->id (".fullname($user).") is over bounce threshold! Not sending.";
|
$bouncemsg = "User $user->id (".fullname($user).") is over bounce threshold! Not sending.";
|
||||||
error_log($bouncemsg);
|
error_log($bouncemsg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user