mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-48080 email: Do not send to .invalid addresses. It is an invalid TLD
This commit is contained in:
parent
f1c4e3d2ba
commit
90e30644d5
@ -5809,6 +5809,13 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '',
|
||||
return false;
|
||||
}
|
||||
|
||||
// TLD .invalid is specifically reserved for invalid domain names.
|
||||
// For More information, see {@link http://tools.ietf.org/html/rfc2606#section-2}.
|
||||
if (substr($user->email, -8) == '.invalid') {
|
||||
debugging("email_to_user: User $user->id (".fullname($user).") email domain ($user->email) is invalid! Not sending.");
|
||||
return true; // This is not an error.
|
||||
}
|
||||
|
||||
// If the user is a remote mnet user, parse the email text for URL to the
|
||||
// wwwroot and modify the url to direct the user's browser to login at their
|
||||
// home site (identity provider - idp) before hitting the link itself.
|
||||
|
Loading…
x
Reference in New Issue
Block a user