That option is part of the group settings.
See also Add users to a group based on their email domain