The builtin email filter $CFG->emailfilter for new accounts is a bit limited. It only allows accounts from a single domain. The patch included in this ticket adds the following:
- You can now use a regular expression for the match. For example:
$CFG->emailfilter = '/.*\.org$/';
This will allow everybody with a .org email address to register. See the manual of preg_match for the syntax of the regular expressions.
- You can now use an array in the email filter to allow multiple domains:
$CFG->emailfilter = array('elgg.org', 'gmail.com');
Naturally, any entry in the array can be a regular expression.
- In addition to the email filter, there is now a email block list that works in a similar way. It allows you to block any domain you with:
$CFG->emailblock = array('hotmail.com', '/\.*\.org$/');
This blocks anything from hotmail or any .org address.
You can use both $CFG->emailfilter and $CFG->emailblock at the same time. The block list will have precedence.